Skip to main content
Version: 2.x

@cognite/reveal / Modules

@cognite/reveal has three modules:

Classes

@cognite/reveal / Modules / @cognite/reveal / AssetNodeCollection

Class: AssetNodeCollection

@cognite/reveal.AssetNodeCollection

Represents a set of nodes associated with an asset in Cognite Fusion linked to the 3D model using asset mappings. A node is considered to be part of an asset if it has a direct asset mapping or if one of its ancestors has an asset mapping to the asset.

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new AssetNodeCollection(client, model)

Parameters
NameType
clientdefault
modelCognite3DModel
Overrides

NodeCollectionBase.constructor

Defined in

viewer/core/src/datamodels/cad/styling/AssetNodeCollection.ts:30

Properties

classToken

Static Readonly classToken: "AssetNodeCollection"

Defined in

viewer/core/src/datamodels/cad/styling/AssetNodeCollection.ts:24

Accessors

classToken

get classToken(): string

Returns

string

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:25


isLoading

get isLoading(): boolean

Returns true when the set currently is running an operation for loading the full set of nodes contained by the set.

Returns

boolean

Defined in

viewer/core/src/datamodels/cad/styling/AssetNodeCollection.ts:39

Methods

clear

clear(): void

Returns

void

Overrides

NodeCollectionBase.clear

Defined in

viewer/core/src/datamodels/cad/styling/AssetNodeCollection.ts:93


executeFilter

executeFilter(filter): Promise<void>

Updates the node collection to hold nodes associated with the asset given, or assets within the bounding box or all assets associated with the 3D model.

Parameters
NameTypeDescription
filterObject
filter.assetId?numberID of a single asset (optional)
filter.boundingBox?Box3When provided, only assets within the provided bounds will be included in the filter.
Returns

Promise<void>

Defined in

viewer/core/src/datamodels/cad/styling/AssetNodeCollection.ts:50


getIndexSet

getIndexSet(): IndexSet

Returns

IndexSet

Overrides

NodeCollectionBase.getIndexSet

Defined in

viewer/core/src/datamodels/cad/styling/AssetNodeCollection.ts:100


off

off(event, listener): void

Unsubscribe a listener to events about the set changing, i.e. when nodes are added or removed to the set.

Parameters
NameType
event"changed"
listener() => void
Returns

void

Inherited from

NodeCollectionBase.off

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:42


on

on(event, listener): void

Subscribe a listener to events about the set changing, i.e. when nodes are added or removed to the set.

Parameters
NameType
event"changed"
listener() => void
Returns

void

Inherited from

NodeCollectionBase.on

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:33


serialize

serialize(): SerializedNodeCollection

Returns

SerializedNodeCollection

Overrides

NodeCollectionBase.serialize

Defined in

viewer/core/src/datamodels/cad/styling/AssetNodeCollection.ts:104

@cognite/reveal / Modules / @cognite/reveal / BoundingBoxClipper

Class: BoundingBoxClipper

@cognite/reveal.BoundingBoxClipper

Table of contents

Constructors

Accessors

Constructors

constructor

new BoundingBoxClipper(box?)

Parameters
NameType
box?Box3
Defined in

viewer/core/src/utilities/BoundingBoxClipper.ts:16

Accessors

clippingPlanes

get clippingPlanes(): Plane[]

Returns

Plane[]

Defined in

viewer/core/src/utilities/BoundingBoxClipper.ts:104


maxX

get maxX(): number

Returns

number

Defined in

viewer/core/src/utilities/BoundingBoxClipper.ts:55

set maxX(x): void

Parameters
NameType
xnumber
Returns

void

Defined in

viewer/core/src/utilities/BoundingBoxClipper.ts:50


maxY

get maxY(): number

Returns

number

Defined in

viewer/core/src/utilities/BoundingBoxClipper.ts:64

set maxY(y): void

Parameters
NameType
ynumber
Returns

void

Defined in

viewer/core/src/utilities/BoundingBoxClipper.ts:59


maxZ

get maxZ(): number

Returns

number

Defined in

viewer/core/src/utilities/BoundingBoxClipper.ts:73

set maxZ(z): void

Parameters
NameType
znumber
Returns

void

Defined in

viewer/core/src/utilities/BoundingBoxClipper.ts:68


minX

get minX(): number

Returns

number

Defined in

viewer/core/src/utilities/BoundingBoxClipper.ts:28

set minX(x): void

Parameters
NameType
xnumber
Returns

void

Defined in

viewer/core/src/utilities/BoundingBoxClipper.ts:23


minY

get minY(): number

Returns

number

Defined in

viewer/core/src/utilities/BoundingBoxClipper.ts:37

set minY(y): void

Parameters
NameType
ynumber
Returns

void

Defined in

viewer/core/src/utilities/BoundingBoxClipper.ts:32


minZ

get minZ(): number

Returns

number

Defined in

viewer/core/src/utilities/BoundingBoxClipper.ts:46

set minZ(z): void

Parameters
NameType
znumber
Returns

void

Defined in

viewer/core/src/utilities/BoundingBoxClipper.ts:41

@cognite/reveal / Modules / @cognite/reveal / Cognite3DModel

Class: Cognite3DModel

@cognite/reveal.Cognite3DModel

Hierarchy

  • Object3D

    Cognite3DModel

Implements

Table of contents

Properties

Accessors

Methods

Properties

modelId

Readonly modelId: number

The CDF model ID of the model.

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:61


revisionId

Readonly revisionId: number

The CDF revision ID of the model.

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:65


type

Readonly type: SupportedModelTypes = 'cad'

Implementation of

CogniteModelBase.type

Overrides

THREE.Object3D.type

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:28

Accessors

modelUnit

get modelUnit(): "" | WellKnownUnit

Returns the unit the coordinates for the model is stored. Returns an empty string if no unit has been stored. Note that coordinates in Reveal always are converted to meters using @see {@link modelUnitToMetersFactor}.

version New since 2.1

Returns

"" | WellKnownUnit

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:43


modelUnitToMetersFactor

get modelUnitToMetersFactor(): number

Returns the conversion factor that converts from model coordinates to meters. Note that this can return undefined if the model has been stored in an unsupported unit.

version New since 2.1

Returns

number

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:54


nodeCount

get nodeCount(): number

Returns the number of nodes in the model.

Returns

number

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:453


styledNodeCollections

get styledNodeCollections(): { appearance: NodeAppearance ; nodeCollection: NodeCollectionBase }[]

Returns all currently registered node collections and associated appearance.

Returns

{ appearance: NodeAppearance ; nodeCollection: NodeCollectionBase }[]

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:127

Methods

assignStyledNodeCollection

assignStyledNodeCollection(nodeCollection, appearance): void

Customizes rendering style for a set of nodes, e.g. to highlight, hide or color code a set of 3D objects. This allows for custom look and feel of the 3D model which is useful to highlight certain parts or to color code the 3D model based on information (e.g. coloring the 3D model by construction status).

The NodeCollectionBase can be updated dynamically and the rendered nodes will be updated automatically as the styling changes. The appearance of the style nodes cannot be changed.

When nodes are in several styled sets, the style is combined in the order the sets were added, i.e. styled sets added late can overwrite styled sets added early.

If the nodeCollection provided already has an assigned style, this style will be replaced with style provided.

example

model.setDefaultNodeAppearance({ rendererGhosted: true });
const visibleNodes = new TreeIndexNodeCollection(someTreeIndices);
model.assignStyledNodeCollection(visibleSet, { rendererGhosted: false });

throws Error if node collection already has been assigned to the model.

Parameters
NameTypeDescription
nodeCollectionNodeCollectionBaseDynamic set of nodes to apply the provided appearance to.
appearanceNodeAppearanceAppearance to style the provided set with.
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:159


dispose

dispose(): void

Cleans up used resources.

Returns

void

Implementation of

CogniteModelBase.dispose

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:291


getAncestorTreeIndices

getAncestorTreeIndices(treeIndex, generation): Promise<NumericRange>

Determines the tree index range of a subtree of an ancestor of the provided node defined by a tree index.

Parameters
NameTypeDescription
treeIndexnumberTree index of node to find ancestor tree index range for.
generationnumberWhat "generation" to find. 0 is the node itself, 1 means parent, 2 means grandparent etc. If the node doesn't have as many ancestors, the root of the model is returned. This can be determined by checking that the range returned includes 0.
Returns

Promise<NumericRange>

Tree index range of the subtree spanned by the ancestor at the "generation" specified, or the root.

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:315


getBoundingBoxByNodeId

getBoundingBoxByNodeId(nodeId, box?): Promise<Box3>

Fetches a bounding box from the CDF by the nodeId.

example

const box = new THREE.Box3()
const nodeId = 100500;
await model.getBoundingBoxByNodeId(nodeId, box);
// box now has the bounding box
// the following code does the same
const box = await model.getBoundingBoxByNodeId(nodeId);
Parameters
NameTypeDescription
nodeIdnumber
box?Box3Optional. Used to write result to.
Returns

Promise<Box3>

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:398


getBoundingBoxByTreeIndex

getBoundingBoxByTreeIndex(treeIndex, box?): Promise<Box3>

Determine the bounding box of the node identified by the tree index provided. Note that this function uses the CDF API to look up the bounding box.

example

const box = new THREE.Box3()
const treeIndex = 42;
await model.getBoundingBoxByTreeIndex(treeIndex, box);
// box now has the bounding box
// the following code does the same
const box = await model.getBoundingBoxByTreeIndex(treeIndex);
Parameters
NameTypeDescription
treeIndexnumberTree index of the node to find bounding box for.
box?Box3Optional preallocated container to hold the bounding box.
Returns

Promise<Box3>

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:429


getCameraConfiguration

getCameraConfiguration(): CameraConfiguration

Retrieves the camera position and target stored for the model. Typically this is used to store a good starting position for a model. Returns undefined if there isn't any stored camera configuration for the model.

Returns

CameraConfiguration

Implementation of

CogniteModelBase.getCameraConfiguration

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:362


getDefaultNodeAppearance

getDefaultNodeAppearance(): NodeAppearance

Gets the default appearance for nodes that are not styled using assignStyledNodeCollection.

Returns

NodeAppearance

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:120


getModelBoundingBox

getModelBoundingBox(outBbox?, restrictToMostGeometry?): Box3

Determines the full bounding box of the model.

example

const box = new THREE.Box3()
model.getModelBoundingBox(box);
// box now has the bounding box
// the following code does the same
const box = model.getModelBoundingBox();
Parameters
NameTypeDescription
outBbox?Box3Optional. Used to write result to.
restrictToMostGeometry?booleanOptional. When true, returned bounds are restricted to where most of the geometry is located. This is useful for models that have junk geometry located far from the "main" model. Added in version 1.3.0.
Returns

Box3

Model bounding box.

Implementation of

CogniteModelBase.getModelBoundingBox

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:346


getModelTransformation

getModelTransformation(out?): Matrix4

Gets transformation matrix of the model.

Parameters
NameTypeDescription
out?Matrix4Preallocated THREE.Matrix4 (optional).
Returns

Matrix4

Implementation of

CogniteModelBase.getModelTransformation

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:378


getSubtreeTreeIndices

getSubtreeTreeIndices(treeIndex): Promise<NumericRange>

Determines the range of tree indices for a given subtree.

Parameters
NameTypeDescription
treeIndexnumberIndex of the root of the subtree to get the index range for.
Returns

Promise<NumericRange>

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:299


iterateNodesByTreeIndex

iterateNodesByTreeIndex(action): Promise<void>

Iterates over all nodes in the model and applies the provided action to each node (identified by tree index). The passed action is applied incrementally to avoid main thread blocking, meaning that the changes can be partially applied until promise is resolved (iteration is done).

example

const logIndex = (treeIndex) => console.log(treeIndex);
await model.iterateNodesByTreeIndex(logIndex); // 0, 1, 2, ...
Parameters
NameTypeDescription
action(treeIndex: number) => voidFunction that will be called with a treeIndex argument.
Returns

Promise<void>

Promise that is resolved once the iteration is done.

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:446


iterateSubtreeByTreeIndex

iterateSubtreeByTreeIndex(treeIndex, action): Promise<void>

Iterates over all nodes in a subtree of the model and applies the provided action to each node (identified by tree index). The provided node is included in the visited set. The passed action is applied incrementally to avoid main thread blocking, meaning that the changes can be partially applied until promise is resolved (iteration is done).

example

// make a subtree to be gray
await model.iterateNodesByTreeIndex(treeIndex => {
model.setNodeColorByTreeIndex(treeIndex, 127, 127, 127);
});
Parameters
NameTypeDescription
treeIndexnumberTree index of the top parent of the subtree.
action(treeIndex: number) => voidFunction that will be called with a treeIndex argument.
Returns

Promise<void>

Promise that is resolved once the iteration is done.

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:473


mapBoxFromModelToCdfCoordinates

mapBoxFromModelToCdfCoordinates(box, out?): Box3

Maps from a 3D position in "ThreeJS model space" to coordinates in "CDF space". This is necessary because CDF has a right-handed Z-up coordinate system while ThreeJS uses a right-hand Y-up coordinate system. This function also accounts for transformation applied to the model.

Parameters
NameTypeDescription
boxBox3The box in ThreeJS/model coordinates.
out?Box3Optional preallocated buffer for storing the result. May be box.
Returns

Box3

Transformed box.

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:279


mapFromCdfToModelCoordinates

mapFromCdfToModelCoordinates(p, out?): Vector3

Maps a position retrieved from the CDF API (e.g. 3D node information) to coordinates in "ThreeJS model space". This is necessary because CDF has a right-handed Z-up coordinate system while ThreeJS uses a right-hand Y-up coordinate system.

Parameters
NameTypeDescription
pVector3The CDF coordinate to transform.
out?Vector3Optional preallocated buffer for storing the result. May be p.
Returns

Vector3

Transformed position.

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:243


mapNodeIdToTreeIndex

mapNodeIdToTreeIndex(nodeId): Promise<number>

Maps a single node ID to tree index. This is useful when you e.g. have a node ID from an asset mapping and want to highlight the given asset using mapNodeIdsToTreeIndices is recommended for better performance when mapping multiple IDs.

throws If an invalid/non-existant node ID is provided the function throws an error.

Parameters
NameTypeDescription
nodeIdnumberA Node ID to map to a tree index.
Returns

Promise<number>

TreeIndex of the provided node.

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:528


mapNodeIdsToTreeIndices

mapNodeIdsToTreeIndices(nodeIds): Promise<number[]>

Maps a list of Node IDs to tree indices. This function is useful when you have a list of nodes, e.g. from Asset Mappings, that you want to highlight, hide, color etc in the viewer.

throws If an invalid/non-existant node ID is provided the function throws an error.

Parameters
NameTypeDescription
nodeIdsnumber[]List of node IDs to map to tree indices.
Returns

Promise<number[]>

A list of tree indices corresponing to the elements in the input.

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:514


mapPositionFromModelToCdfCoordinates

mapPositionFromModelToCdfCoordinates(p, out?): Vector3

Maps from a 3D position in "ThreeJS model space" (e.g. a ray intersection coordinate) to coordinates in "CDF space". This is necessary because CDF has a right-handed Z-up coordinate system while ThreeJS uses a right-hand Y-up coordinate system. This function also accounts for transformation applied to the model.

Parameters
NameTypeDescription
pVector3The ThreeJS coordinate to transform.
out?Vector3Optional preallocated buffer for storing the result. May be p.
Returns

Vector3

Transformed position.

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:261


mapTreeIndexToNodeId

mapTreeIndexToNodeId(treeIndex): Promise<number>

Maps a single tree index to node ID for use with the API. If you have multiple tree indices to map, mapNodeIdsToTreeIndices is recommended for better performance.

throws If an invalid/non-existent node ID is provided the function throws an error.

Parameters
NameTypeDescription
treeIndexnumberA tree index to map to a Node ID.
Returns

Promise<number>

TreeIndex of the provided node.

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:554


mapTreeIndicesToNodeIds

mapTreeIndicesToNodeIds(treeIndices): Promise<number[]>

Maps a list of tree indices to node IDs for use with the Cognite SDK. This function is useful if you have a list of tree indices, e.g. from Cognite3DModel.iterateSubtreeByTreeIndex, and want to perform some operations on these nodes using the SDK.

throws If an invalid tree index is provided the function throws an error.

Parameters
NameTypeDescription
treeIndicesnumber[]Tree indices to map to node IDs.
Returns

Promise<number[]>

A list of node IDs corresponding to the elements of the input.

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:542


removeAllStyledNodeCollections

removeAllStyledNodeCollections(): void

Removes all styled collections, resetting the appearance of all nodes to the default appearance.

Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:209


resetNodeTransform

resetNodeTransform(treeIndices): void

Resets the transformation for the nodes given.

Parameters
NameTypeDescription
treeIndicesNumericRangeTree indices of the nodes to reset transforms for.
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:231


resetNodeTransformByTreeIndex

resetNodeTransformByTreeIndex(treeIndex, applyToChildren?): Promise<number>

Remove override transform of the node by tree index.

Parameters
NameTypeDefault value
treeIndexnumberundefined
applyToChildrenbooleantrue
Returns

Promise<number>

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:499


setDefaultNodeAppearance

setDefaultNodeAppearance(appearance): void

Sets the default appearance for nodes that are not styled using assignStyledNodeCollection. Updating the default style can be an expensive operation, so use with care.

Parameters
NameTypeDescription
appearanceNodeAppearanceDefault node appearance.
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:112


setModelTransformation

setModelTransformation(matrix): void

Sets transformation matrix of the model. This overrides the current transformation.

Parameters
NameTypeDescription
matrixMatrix4Transformation matrix.
Returns

void

Implementation of

CogniteModelBase.setModelTransformation

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:370


setNodeTransform

setNodeTransform(treeIndices, transformMatrix): void

Apply a transformation matrix to the tree indices given, changing rotation, scale and/or position.

Note that setting multiple transformations for the same node isn't supported and might lead to undefined results.

Parameters
NameTypeDescription
treeIndicesNumericRangeTree indices of nodes to apply the transformation to.
transformMatrixMatrix4Transformation to apply.
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:223


setNodeTransformByTreeIndex

setNodeTransformByTreeIndex(treeIndex, transform, applyToChildren?): Promise<number>

Set override transform of the node by tree index.

Parameters
NameTypeDefault value
treeIndexnumberundefined
transformMatrix4undefined
applyToChildrenbooleantrue
Returns

Promise<number>

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:484


unassignStyledNodeCollection

unassignStyledNodeCollection(nodeCollection): void

Removes styling for previously added styled collection, resetting the style to the default (or the style imposed by other styled collections).

throws Error if node collection isn't assigned to the model.

Parameters
NameTypeDescription
nodeCollectionNodeCollectionBaseNode collection previously added using assignStyledNodeCollection.
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:195


updateStyledNodeCollection

updateStyledNodeCollection(nodeCollection, newAppearance): void

Updates styled node collections with a new appearance.

throws Error if node collection hasn't previously been assigned using assignStyledNodeCollection.

Parameters
NameTypeDescription
nodeCollectionNodeCollectionBaseA node collection previously assigned using assignStyledNodeCollection.
newAppearanceNodeAppearanceNew appearance for the nodes in the collection.
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DModel.ts:179

@cognite/reveal / Modules / @cognite/reveal / Cognite3DViewer

Class: Cognite3DViewer

@cognite/reveal.Cognite3DViewer

Table of contents

Constructors

Accessors

Methods

Constructors

constructor

new Cognite3DViewer(options)

Parameters
NameType
optionsCognite3DViewerOptions
Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:193

Accessors

cadBudget

get cadBudget(): CadModelBudget

Gets the current budget for downloading geometry for CAD models. Note that this budget is shared between all added CAD models and not a per-model budget.

Returns

CadModelBudget

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:149

set cadBudget(budget): void

Sets the current budget for downloading geometry for CAD models. Note that this budget is shared between all added CAD models and not a per-model budget.

Parameters
NameType
budgetCadModelBudget
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:159


cameraControls

get cameraControls(): ComboControls

Gets the camera controller. See https://www.npmjs.com/package/@cognite/three-combo-controls for documentation. Note that by default the minDistance setting of the controls will be automatic. This can be disabled using Cognite3DViewerOptions.automaticControlsSensitivity.

Returns

ComboControls

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:898


cameraControlsEnabled

get cameraControlsEnabled(): boolean

Gets whether camera controls through mouse, touch and keyboard are enabled.

Returns

boolean

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:905

set cameraControlsEnabled(enabled): void

Sets whether camera controls through mouse, touch and keyboard are enabled. This can be useful to e.g. temporarily disable navigation when manipulating other objects in the scene or when implementing a "cinematic" viewer.

Parameters
NameType
enabledboolean
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:914


domElement

get domElement(): HTMLElement

The DOM element the viewer will insert its rendering canvas into. The DOM element can be specified in the options when the viewer is created. If not specified, the DOM element will be created automatically. The DOM element cannot be changed after the viewer has been created.

Returns

HTMLElement

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:86


models

get models(): CogniteModelBase[]

Gets a list of models currently added to the viewer.

Returns

CogniteModelBase[]

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:184


pointCloudBudget

get pointCloudBudget(): PointCloudBudget

Returns the point cloud budget. The budget is shared between all loaded point cloud models.

Returns

PointCloudBudget

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:169

set pointCloudBudget(budget): void

Sets the point cloud budget. The budget is shared between all loaded point cloud models.

Parameters
NameType
budgetPointCloudBudget
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:177


renderer

get renderer(): WebGLRenderer

Returns the renderer used to produce images from 3D geometry.

Returns

WebGLRenderer

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:93

Methods

addCadModel

addCadModel(options): Promise<Cognite3DModel>

Add a new CAD 3D model to the viewer. Call Cognite3DViewer.fitCameraToModel to see the model after the model has loaded.

example

const options = {
modelId: 'COGNITE_3D_MODEL_ID',
revisionId: 'COGNITE_3D_REVISION_ID',
};
viewer.addCadModel(options).then(model => {
viewer.fitCameraToModel(model, 0);
});
Parameters
NameType
optionsAddModelOptions
Returns

Promise<Cognite3DModel>

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:561


addModel

addModel(options): Promise<Cognite3DModel | CognitePointCloudModel>

Add a new model to the viewer. Call Cognite3DViewer.fitCameraToModel to see the model after the model has loaded.

example

const options = {
modelId: 'COGNITE_3D_MODEL_ID',
revisionId: 'COGNITE_3D_REVISION_ID',
};
viewer.addModel(options).then(model => {
viewer.fitCameraToModel(model, 0);
});
Parameters
NameType
optionsAddModelOptions
Returns

Promise<Cognite3DModel | CognitePointCloudModel>

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:528


addObject3D

addObject3D(object): void

Add a THREE.Object3D to the viewer.

example

const sphere = new THREE.Mesh(
new THREE.SphereBufferGeometry(),
new THREE.MeshBasicMaterial()
);
viewer.addObject3D(sphere);
Parameters
NameType
objectObject3D<Event>
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:692


addPointCloudModel

addPointCloudModel(options): Promise<CognitePointCloudModel>

Add a new pointcloud 3D model to the viewer. Call Cognite3DViewer.fitCameraToModel to see the model after the model has loaded.

example

const options = {
modelId: 'COGNITE_3D_MODEL_ID',
revisionId: 'COGNITE_3D_REVISION_ID',
};
viewer.addPointCloudModel(options).then(model => {
viewer.fitCameraToModel(model, 0);
});
Parameters
NameType
optionsAddModelOptions
Returns

Promise<CognitePointCloudModel>

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:589


addUiObject

addUiObject(object, screenPos, size): void

Add an object that will be considered a UI object. It will be rendered in the last stage and with orthographic projection.

Parameters
NameTypeDescription
objectObject3D<Event>
screenPosVector2Screen space position of object (in pixels).
sizeVector2Pixel width and height of the object.
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:732


determineModelType

determineModelType(modelId, revisionId): Promise<"" | SupportedModelTypes>

Use to determine of which type the model is.

example

const viewer = new Cognite3DViewer(...);
const type = await viewer.determineModelType(options.modelId, options.revisionId)
let model: Cognite3DModel | CognitePointCloudModel
switch (type) {
case 'cad':
model = await viewer.addCadModel(options);
break;
case 'pointcloud':
model = await viewer.addPointCloudModel(options);
break;
default:
throw new Error('Model is not supported');
}
viewer.fitCameraToModel(model);
Parameters
NameTypeDescription
modelIdnumberThe model's id.
revisionIdnumberThe model's revision id.
Returns

Promise<"" | SupportedModelTypes>

Empty string if type is not supported.

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:663


disableKeyboardNavigation

disableKeyboardNavigation(): void

Disables camera movement by pressing WASD or arrows keys.

Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:1001


dispose

dispose(): void

Dispose of WebGL resources. Can be used to free up memory when the viewer is no longer in use.

see https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects

// Viewer is no longer in use, free up memory
viewer.dispose();
```.

##### Returns

`void`

##### Defined in

[viewer/core/src/public/migration/Cognite3DViewer.ts:337](https://github.com/cognitedata/reveal/blob/d2769861/viewer/core/src/public/migration/Cognite3DViewer.ts#L337)

___

#### enableKeyboardNavigation

▸ **enableKeyboardNavigation**(): `void`

Allows to move camera with WASD or arrows keys.

##### Returns

`void`

##### Defined in

[viewer/core/src/public/migration/Cognite3DViewer.ts:994](https://github.com/cognitedata/reveal/blob/d2769861/viewer/core/src/public/migration/Cognite3DViewer.ts#L994)

___

#### fitCameraToBoundingBox

▸ **fitCameraToBoundingBox**(`box`, `duration?`, `radiusFactor?`): `void`

Move camera to a place where the content of a bounding box is visible to the camera.

**`example`**
```js
// Fit camera to bounding box over 500 milliseconds
viewer.fitCameraToBoundingBox(boundingBox, 500);
// Fit camera to bounding box instantaneously
viewer.fitCameraToBoundingBox(boundingBox, 0);
// Place the camera closer to the bounding box
viewer.fitCameraToBoundingBox(boundingBox, 500, 2);
Parameters
NameTypeDefault valueDescription
boxBox3undefinedThe bounding box in world space.
duration?numberundefinedThe duration of the animation moving the camera. Set this to 0 (zero) to disable animation.
radiusFactornumber2The ratio of the distance from camera to center of box and radius of the box.
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:980


fitCameraToModel

fitCameraToModel(model, duration?): void

Move camera to a place where the 3D model is visible. It uses the bounding box of the 3D model and calls Cognite3DViewer.fitCameraToBoundingBox.

example

// Fit camera to model
viewer.fitCameraToModel(model);
// Fit camera to model over 500 milliseconds
viewer.fitCameraToModel(model, 500);
// Fit camera to model instantly
viewer.fitCameraToModel(model, 0);
Parameters
NameTypeDescription
modelCogniteModelBaseThe 3D model.
duration?numberThe duration of the animation moving the camera. Set this to 0 (zero) to disable animation.
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:956


getCamera

getCamera(): PerspectiveCamera

obvious

Returns

PerspectiveCamera

The THREE.Camera used for rendering.

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:816


getCameraControlsOptions

getCameraControlsOptions(): CameraControlsOptions

Gets camera controls mode.

Returns

CameraControlsOptions

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:484


getCameraPosition

getCameraPosition(): Vector3

obvious

Returns

Vector3

Camera's position in world space.

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:832


getCameraTarget

getCameraTarget(): Vector3

obvious

Returns

Vector3

Camera's target in world space.

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:843


getClippingPlanes

getClippingPlanes(): Plane[]

Returns the current active clipping planes.

version New in 2.1

Returns

Plane[]

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:808


getIntersectionFromPixel

getIntersectionFromPixel(offsetX, offsetY, options?): Promise<Intersection>

Raycasting model(s) for finding where the ray intersects with the model.

see https://en.wikipedia.org/wiki/Ray_casting.

example For CAD model

const offsetX = 50 // pixels from the left
const offsetY = 100 // pixels from the top
const intersection = await viewer.getIntersectionFromPixel(offsetX, offsetY);
if (intersection) // it was a hit
console.log(
'You hit model ', intersection.model,
' at the node with tree index ', intersection.treeIndex,
' at this exact point ', intersection.point
);

example For point cloud

const offsetX = 50 // pixels from the left
const offsetY = 100 // pixels from the top
const intersection = await viewer.getIntersectionFromPixel(offsetX, offsetY);
if (intersection) // it was a hit
console.log(
'You hit model ', intersection.model,
' at the point index ', intersection.pointIndex,
' at this exact point ', intersection.point
);
Parameters
NameTypeDescription
offsetXnumberX coordinate in pixels (relative to the domElement).
offsetYnumberY coordinate in pixels (relative to the domElement).
options?IntersectionFromPixelOptionsOptions to control the behavior of the intersection operation. Optional (new in 1.3.0).
Returns

Promise<Intersection>

A promise that if there was an intersection then return the intersection object - otherwise it returns null if there were no intersections.

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:1139


getScene

getScene(): Scene

obvious

Returns

Scene

The THREE.Scene used for rendering.

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:824


getScreenshot

getScreenshot(width?, height?): Promise<string>

Take screenshot from the current camera position.

example

// Take a screenshot with custom resolution
const url = await viewer.getScreenshot(1920, 1080);
// Add a screenshot with resolution of the canvas to the page
const url = await viewer.getScreenshot();
const image = document.createElement('img');
image.src = url;
document.body.appendChild(url);
Parameters
NameTypeDescription
widthnumberWidth of the final image. Default is current canvas size.
heightnumberHeight of the final image. Default is current canvas size.
Returns

Promise<string>

A Data URL of the image ('image/png').

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:1081


getVersion

getVersion(): string

Returns reveal version installed.

Returns

string

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:310


getViewState

getViewState(): ViewerState

Gets the current viewer state which includes the camera pose as well as applied styling.

Returns

ViewerState

JSON object containing viewer state.

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:492


loadCameraFromModel

loadCameraFromModel(model): void

Attempts to load the camera settings from the settings stored for the provided model. See https://docs.cognite.com/api/v1/#operation/get3DRevision and https://docs.cognite.com/api/v1/#operation/update3DRevisions for information on how this setting is retrieved and stored. This setting can also be changed through the 3D models management interface in Cognite Fusion. If no camera configuration is stored in CDF, Cognite3DViewer.fitCameraToModel is used as a fallback.

Parameters
NameTypeDescription
modelCogniteModelBaseThe model to load camera settings from.
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:928


off

off(event, callback): void

example

viewer.off('click', onClick);
Parameters
NameType
event"click" | "hover"
callbackPointerEventDelegate
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:435

off(event, callback): void

Parameters
NameType
event"cameraChange"
callbackCameraChangeDelegate
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:436

off(event, callback): void

Parameters
NameType
event"sceneRendered"
callbackSceneRenderedDelegate
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:437

off(event, callback): void

Parameters
NameType
event"disposed"
callbackDisposedDelegate
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:438


on

on(event, callback): void

Triggered when the viewer is disposed. Listeners should clean up any resources held and remove the reference to the viewer.

Parameters
NameType
event"disposed"
callbackDisposedDelegate
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:368

on(event, callback): void

example

const onClick = (event) => { console.log(event.offsetX, event.offsetY) };
viewer.on('click', onClick);
Parameters
NameType
event"click" | "hover"
callbackPointerEventDelegate
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:377

on(event, callback): void

example

viewer.on('cameraChange', (position, target) => {
console.log('Camera changed: ', position, target);
});
Parameters
NameType
event"cameraChange"
callbackCameraChangeDelegate
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:386

on(event, callback): void

Event that is triggered immediatly after the scene has been rendered.

Parameters
NameTypeDescription
event"sceneRendered"Metadata about the rendering frame.
callbackSceneRenderedDelegateCallback to trigger when the event occurs.
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:392


removeModel

removeModel(model): void

Removes a model that was previously added using Cognite3DViewer.addModel, Cognite3DViewer.addCadModel or Cognite3DViewer.addPointCloudModel .

Parameters
NameType
modelCogniteModelBase
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:611


removeObject3D

removeObject3D(object): void

Remove a THREE.Object3D from the viewer.

example

const sphere = new THREE.Mesh(new THREE.SphereBufferGeometry(), new THREE.MeshBasicMaterial());
viewer.addObject3D(sphere);
viewer.removeObject3D(sphere);
Parameters
NameType
objectObject3D<Event>
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:713


removeUiObject

removeUiObject(object): void

Removes the UI object from the viewer.

Parameters
NameType
objectObject3D<Event>
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:741


requestRedraw

requestRedraw(): void

Typically used when you perform some changes and can't see them unless you move camera.

Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:987


setBackgroundColor

setBackgroundColor(color): void

Sets the color used as the clear color of the renderer.

Parameters
NameType
colorColor
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:751


setCameraControlsOptions

setCameraControlsOptions(controlsOptions): void

Sets camera control options. See CameraControlsOptions.

Parameters
NameTypeDescription
controlsOptionsCameraControlsOptionsJSON object with camera controls options.
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:477


setCameraPosition

setCameraPosition(position): void

obvious

example

// store position, target
const position = viewer.getCameraPosition();
const target = viewer.getCameraTarget();
// restore position, target
viewer.setCameraPosition(position);
viewer.setCameraTarget(target);
Parameters
NameTypeDescription
positionVector3Position in world space.
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:863


setCameraTarget

setCameraTarget(target, animated?): void

Set camera's target.

example

// store position, target
const position = viewer.getCameraPosition();
const target = viewer.getCameraTarget();
// restore position, target
viewer.setCameraPosition(position);
viewer.setCameraTarget(target);
Parameters
NameTypeDefault valueDescription
targetVector3undefinedTarget in world space.
animatedbooleanfalseWhether change of target should be animated or not (default is false).
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:885


setClippingPlanes

setClippingPlanes(clippingPlanes): void

Sets per-pixel clipping planes. Pixels behind any of the planes will be sliced away.

example

// Hide pixels with values less than 0 in the x direction
const plane = new THREE.Plane(new THREE.Vector3(1, 0, 0), 0);
viewer.setClippingPlanes([plane]);
// Hide pixels with values greater than 20 in the x direction
const plane = new THREE.Plane(new THREE.Vector3(-1, 0, 0), 20);
viewer.setClippingPlanes([plane]);
// Hide pixels with values less than 0 in the x direction or greater than 0 in the y direction
const xPlane = new THREE.Plane(new THREE.Vector3(1, 0, 0), 0);
const yPlane = new THREE.Plane(new THREE.Vector3(0, -1, 0), 0);
viewer.setClippingPlanes([xPlane, yPlane]);
// Hide pixels behind an arbitrary, non axis-aligned plane
const plane = new THREE.Plane(new THREE.Vector3(1.5, 20, -19), 20);
viewer.setClippingPlanes([plane]);
// Disable clipping planes
viewer.setClippingPlanes([]);
Parameters
NameTypeDescription
clippingPlanesPlane[]The planes to use for clipping.
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:791


setLogLevel

setLogLevel(level): void

Sets the log level. Used for debugging. Defaults to 'none' (which is identical to 'silent').

Parameters
NameType
level"trace" | "debug" | "info" | "warn" | "error" | "silent" | "none"
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:319


setSlicingPlanes

setSlicingPlanes(slicingPlanes): void

deprecated Since version 2.1, will be removed in version 3.0. Use setClippingPlanes.

Parameters
NameType
slicingPlanesPlane[]
Returns

void

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:800


setViewState

setViewState(state): Promise<void>

Restores camera settings from the state provided, and clears all current styled node collections and applies the state object.

Parameters
NameTypeDescription
stateViewerStateViewer state retrieved from Cognite3DViewer.getViewState.
Returns

Promise<void>

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:502


worldToScreen

worldToScreen(point, normalize?): Vector2

Convert a point in world space to its coordinates in the canvas. This can be used to place HTML objects near 3D objects on top of the 3D viewer.

see https://www.w3schools.com/graphics/canvas_coordinates.asp.

example

const boundingBoxCenter = new THREE.Vector3();
// Find center of bounding box in world space
model.getBoundingBox(nodeId).getCenter(boundingBoxCenter);
// Screen coordinates of that point
const screenCoordinates = viewer.worldToScreen(boundingBoxCenter);
const boundingBoxCenter = new THREE.Vector3();
// Find center of bounding box in world space
model.getBoundingBox(nodeId).getCenter(boundingBoxCenter);
// Screen coordinates of that point normalized in the range [0,1]
const screenCoordinates = viewer.worldToScreen(boundingBoxCenter, true);
const boundingBoxCenter = new THREE.Vector3();
// Find center of bounding box in world space
model.getBoundingBox(nodeId).getCenter(boundingBoxCenter);
// Screen coordinates of that point
const screenCoordinates = viewer.worldToScreen(boundingBoxCenter);
if (screenCoordinates == null) {
// Object not visible on screen
} else {
// Object is visible on screen
}
Parameters
NameTypeDescription
pointVector3World space coordinate.
normalize?booleanOptional. If true, coordinates are normalized into [0,1]. If false, the values are in the range [0, <canvas_size>).
Returns

Vector2

Returns 2D coordinates if the point is visible on screen, or null if object is outside screen.

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:1039


isBrowserSupported

Static isBrowserSupported(): true

For now it just always returns true.

see Https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext#Browser_compatibility.

Returns

true

Defined in

viewer/core/src/public/migration/Cognite3DViewer.ts:76

@cognite/reveal / Modules / @cognite/reveal / CognitePointCloudModel

Class: CognitePointCloudModel

@cognite/reveal.CognitePointCloudModel

Hierarchy

  • Object3D

    CognitePointCloudModel

Implements

Table of contents

Properties

Accessors

Methods

Properties

modelId

Readonly modelId: number

Defined in

viewer/core/src/public/migration/CognitePointCloudModel.ts:19


revisionId

Readonly revisionId: number

The modelId of the point cloud model in Cognite Data Fusion.

Defined in

viewer/core/src/public/migration/CognitePointCloudModel.ts:23


type

Readonly type: SupportedModelTypes = 'pointcloud'

Implementation of

CogniteModelBase.type

Overrides

THREE.Object3D.type

Defined in

viewer/core/src/public/migration/CognitePointCloudModel.ts:18

Accessors

pointColorType

get pointColorType(): PotreePointColorType

Determines how points currently are colored.

Returns

PotreePointColorType

Defined in

viewer/core/src/public/migration/CognitePointCloudModel.ts:146

set pointColorType(type): void

Specifies how points are colored.

default PotreePointColorType.Rgb

example

model.pointColorType = PotreePointColorType.Rgb
Parameters
NameType
typePotreePointColorType
Returns

void

Defined in

viewer/core/src/public/migration/CognitePointCloudModel.ts:158


pointShape

get pointShape(): PotreePointShape

Sets the point shape of each rendered point in the point cloud.

default PotreePointShape.Circle

see PotreePointShape.

Returns

PotreePointShape

Defined in

viewer/core/src/public/migration/CognitePointCloudModel.ts:182

set pointShape(shape): void

Gets the point shape of each rendered point in the point cloud.

see PotreePointShape.

Parameters
NameType
shapePotreePointShape
Returns

void

Defined in

viewer/core/src/public/migration/CognitePointCloudModel.ts:190


pointSize

get pointSize(): number

Returns the size of each rendered point in the point cloud.

Returns

number

Defined in

viewer/core/src/public/migration/CognitePointCloudModel.ts:165

set pointSize(size): void

Sets the size of each rendered point in the point cloud.

default 1

Parameters
NameType
sizenumber
Returns

void

Defined in

viewer/core/src/public/migration/CognitePointCloudModel.ts:173


visiblePointCount

get visiblePointCount(): number

Returns the current number of visible/loaded points.

Returns

number

Defined in

viewer/core/src/public/migration/CognitePointCloudModel.ts:139

Methods

dispose

dispose(): void

Used to clean up memory.

Returns

void

Implementation of

CogniteModelBase.dispose

Defined in

viewer/core/src/public/migration/CognitePointCloudModel.ts:48


getCameraConfiguration

getCameraConfiguration(): CameraConfiguration

Retrieves the camera position and target stored for the model. Typically this is used to store a good starting position for a model. Returns undefined if there isn't any stored camera configuration for the model.

Returns

CameraConfiguration

Implementation of

CogniteModelBase.getCameraConfiguration

Defined in

viewer/core/src/public/migration/CognitePointCloudModel.ts:76


getClasses

getClasses(): number[]

Returns a list of sorted classification codes present in the model.

Returns

number[]

A sorted list of classification codes from the model.

Defined in

viewer/core/src/public/migration/CognitePointCloudModel.ts:132


getModelBoundingBox

getModelBoundingBox(outBbox?): Box3

example

const box = new THREE.Box3()
model.getModelBoundingBox(box);
// box now has the bounding box
// the following code does the same
const box = model.getModelBoundingBox();
Parameters
NameTypeDescription
outBbox?Box3Optional. Used to write result to.
Returns

Box3

Model's bounding box.

Implementation of

CogniteModelBase.getModelBoundingBox

Defined in

viewer/core/src/public/migration/CognitePointCloudModel.ts:67


getModelTransformation

getModelTransformation(out?): Matrix4

Gets transformation matrix of the model.

Parameters
NameTypeDescription
out?Matrix4Preallocated THREE.Matrix4 (optional).
Returns

Matrix4

Implementation of

CogniteModelBase.getModelTransformation

Defined in

viewer/core/src/public/migration/CognitePointCloudModel.ts:92


hasClass

hasClass(pointClass): boolean

Returns true if the model has values with the given classification class.

Parameters
NameTypeDescription
pointClassnumberASPRS classification class code. Either one of the well known classes from WellKnownAsprsPointClassCodes or a number for user defined classes.
Returns

boolean

True if model has values in the class given.

Defined in

viewer/core/src/public/migration/CognitePointCloudModel.ts:124


isClassVisible

isClassVisible(pointClass): boolean

Determines if points from a given class are visible.

throws Error if the model doesn't have the class given.

Parameters
NameTypeDescription
pointClassnumberASPRS classification class code. Either one of the well known classes from WellKnownAsprsPointClassCodes or a number for user defined classes.
Returns

boolean

True if points from the given class will be visible.

Defined in

viewer/core/src/public/migration/CognitePointCloudModel.ts:114


setClassVisible

setClassVisible(pointClass, visible): void

Sets a visible filter on points of a given class.

throws Error if the model doesn't have the class given.

Parameters
NameTypeDescription
pointClassnumberASPRS classification class code. Either one of the well known classes from WellKnownAsprsPointClassCodes or a number for user defined classes.
visiblebooleanBoolean flag that determines if the point class type should be visible or not.
Returns

void

Defined in

viewer/core/src/public/migration/CognitePointCloudModel.ts:103


setModelTransformation

setModelTransformation(transformationMatrix): void

Sets transformation matrix of the model. This overrides the current transformation.

Parameters
NameType
transformationMatrixMatrix4
Returns

void

Implementation of

CogniteModelBase.setModelTransformation

Defined in

viewer/core/src/public/migration/CognitePointCloudModel.ts:84

@cognite/reveal / Modules / @cognite/reveal / IndexSet

Class: IndexSet

@cognite/reveal.IndexSet

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new IndexSet(values?)

Parameters
NameType
values?Iterable<number>
Defined in

viewer/packages/utilities/src/indexset/IndexSet.ts:11

new IndexSet(values?)

Parameters
NameType
values?NumericRange
Defined in

viewer/packages/utilities/src/indexset/IndexSet.ts:13

Properties

rootNode

Optional rootNode: IndexNode

Defined in

viewer/packages/utilities/src/indexset/IndexSet.ts:11

Accessors

count

get count(): number

Returns

number

Defined in

viewer/packages/utilities/src/indexset/IndexSet.ts:68

Methods

add

add(index): void

Parameters
NameType
indexnumber
Returns

void

Defined in

viewer/packages/utilities/src/indexset/IndexSet.ts:33


addRange

addRange(range): void

Parameters
NameType
rangeNumericRange
Returns

void

Defined in

viewer/packages/utilities/src/indexset/IndexSet.ts:39


clear

clear(): void

Returns

void

Defined in

viewer/packages/utilities/src/indexset/IndexSet.ts:203


clone

clone(): IndexSet

Returns

IndexSet

Defined in

viewer/packages/utilities/src/indexset/IndexSet.ts:207


contains

contains(index): boolean

Parameters
NameType
indexnumber
Returns

boolean

Defined in

viewer/packages/utilities/src/indexset/IndexSet.ts:60


differenceWith

differenceWith(otherSet): IndexSet

Parameters
NameType
otherSetIndexSet
Returns

IndexSet

Defined in

viewer/packages/utilities/src/indexset/IndexSet.ts:135


forEachRange

forEachRange(visitor): void

Parameters
NameType
visitor(range: NumericRange) => void
Returns

void

Defined in

viewer/packages/utilities/src/indexset/IndexSet.ts:27


hasIntersectionWith

hasIntersectionWith(otherSet): boolean

Parameters
NameType
otherSetIndexSet | Set<number>
Returns

boolean

Defined in

viewer/packages/utilities/src/indexset/IndexSet.ts:145


intersectWith

intersectWith(otherSet): IndexSet

Parameters
NameType
otherSetIndexSet
Returns

IndexSet

Defined in

viewer/packages/utilities/src/indexset/IndexSet.ts:163


invertedRanges

invertedRanges(): NumericRange[]

Returns

NumericRange[]

Defined in

viewer/packages/utilities/src/indexset/IndexSet.ts:105


remove

remove(index): void

Parameters
NameType
indexnumber
Returns

void

Defined in

viewer/packages/utilities/src/indexset/IndexSet.ts:47


removeRange

removeRange(range): void

Parameters
NameType
rangeNumericRange
Returns

void

Defined in

viewer/packages/utilities/src/indexset/IndexSet.ts:52


toIndexArray

toIndexArray(): number[]

Returns

number[]

Defined in

viewer/packages/utilities/src/indexset/IndexSet.ts:84


toPlainSet

toPlainSet(): Set<number>

Returns

Set<number>

Defined in

viewer/packages/utilities/src/indexset/IndexSet.ts:98


toRangeArray

toRangeArray(): NumericRange[]

Returns

NumericRange[]

Defined in

viewer/packages/utilities/src/indexset/IndexSet.ts:76


unionWith

unionWith(otherSet): IndexSet

Parameters
NameType
otherSetIndexSet
Returns

IndexSet

Defined in

viewer/packages/utilities/src/indexset/IndexSet.ts:123

@cognite/reveal / Modules / @cognite/reveal / IntersectionNodeCollection

Class: IntersectionNodeCollection

@cognite/reveal.IntersectionNodeCollection

Node collection that is the intersection between a set of underlying node collections.

Hierarchy

  • CombineNodeCollectionBase

    IntersectionNodeCollection

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new IntersectionNodeCollection(nodeCollections?)

Parameters
NameType
nodeCollections?NodeCollectionBase[]
Overrides

CombineNodeCollectionBase.constructor

Defined in

viewer/packages/cad-styling/src/IntersectionNodeCollection.ts:14

Properties

classToken

Static Readonly classToken: "IntersectionNodeCollection"

Defined in

viewer/packages/cad-styling/src/IntersectionNodeCollection.ts:14

Accessors

classToken

get classToken(): string

Returns

string

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:25


isLoading

get isLoading(): boolean

override

Returns

boolean

Defined in

viewer/packages/cad-styling/src/CombineNodeCollectionBase.ts:65

Methods

add

add(nodeCollection): void

Parameters
NameType
nodeCollectionNodeCollectionBase
Returns

void

Inherited from

CombineNodeCollectionBase.add

Defined in

viewer/packages/cad-styling/src/CombineNodeCollectionBase.ts:24


clear

clear(): void

Clears all underlying node collections.

Returns

void

Inherited from

CombineNodeCollectionBase.clear

Defined in

viewer/packages/cad-styling/src/CombineNodeCollectionBase.ts:44


getIndexSet

getIndexSet(): IndexSet

override

Returns

IndexSet

Inherited from

CombineNodeCollectionBase.getIndexSet

Defined in

viewer/packages/cad-styling/src/CombineNodeCollectionBase.ts:57


off

off(event, listener): void

Unsubscribe a listener to events about the set changing, i.e. when nodes are added or removed to the set.

Parameters
NameType
event"changed"
listener() => void
Returns

void

Inherited from

CombineNodeCollectionBase.off

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:42


on

on(event, listener): void

Subscribe a listener to events about the set changing, i.e. when nodes are added or removed to the set.

Parameters
NameType
event"changed"
listener() => void
Returns

void

Inherited from

CombineNodeCollectionBase.on

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:33


remove

remove(nodeCollection): void

Parameters
NameType
nodeCollectionNodeCollectionBase
Returns

void

Inherited from

CombineNodeCollectionBase.remove

Defined in

viewer/packages/cad-styling/src/CombineNodeCollectionBase.ts:30


serialize

serialize(): SerializedNodeCollection

Returns

SerializedNodeCollection

Overrides

CombineNodeCollectionBase.serialize

Defined in

viewer/packages/cad-styling/src/IntersectionNodeCollection.ts:20

@cognite/reveal / Modules / @cognite/reveal / InvertedNodeCollection

Class: InvertedNodeCollection

@cognite/reveal.InvertedNodeCollection

Node collection that inverts the result from another node collection.

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new InvertedNodeCollection(model, innerSet)

Parameters
NameType
modelCognite3DModel
innerSetNodeCollectionBase
Overrides

NodeCollectionBase.constructor

Defined in

viewer/core/src/datamodels/cad/styling/InvertedNodeCollection.ts:17

Properties

classToken

Static Readonly classToken: "InvertedNodeCollection"

Defined in

viewer/core/src/datamodels/cad/styling/InvertedNodeCollection.ts:13

Accessors

classToken

get classToken(): string

Returns

string

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:25


isLoading

get isLoading(): boolean

Returns true when the set currently is running an operation for loading the full set of nodes contained by the set.

Returns

boolean

Defined in

viewer/core/src/datamodels/cad/styling/InvertedNodeCollection.ts:30

Methods

clear

clear(): never

Not supported.

throws Always throws an error.

Returns

never

Overrides

NodeCollectionBase.clear

Defined in

viewer/core/src/datamodels/cad/styling/InvertedNodeCollection.ts:52


getIndexSet

getIndexSet(): IndexSet

Returns

IndexSet

Overrides

NodeCollectionBase.getIndexSet

Defined in

viewer/core/src/datamodels/cad/styling/InvertedNodeCollection.ts:34


off

off(event, listener): void

Unsubscribe a listener to events about the set changing, i.e. when nodes are added or removed to the set.

Parameters
NameType
event"changed"
listener() => void
Returns

void

Inherited from

NodeCollectionBase.off

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:42


on

on(event, listener): void

Subscribe a listener to events about the set changing, i.e. when nodes are added or removed to the set.

Parameters
NameType
event"changed"
listener() => void
Returns

void

Inherited from

NodeCollectionBase.on

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:33


serialize

serialize(): SerializedNodeCollection

Returns

SerializedNodeCollection

Overrides

NodeCollectionBase.serialize

Defined in

viewer/core/src/datamodels/cad/styling/InvertedNodeCollection.ts:45

@cognite/reveal / Modules / @cognite/reveal / NodeAppearanceProvider

Class: NodeAppearanceProvider

@cognite/reveal.NodeAppearanceProvider

Table of contents

Constructors

Accessors

Methods

Constructors

constructor

new NodeAppearanceProvider()

Accessors

isLoading

get isLoading(): boolean

Returns

boolean

Defined in

viewer/packages/cad-styling/src/NodeAppearanceProvider.ts:113

Methods

applyStyles

applyStyles(applyCb): void

Parameters
NameType
applyCbApplyStyleDelegate
Returns

void

Defined in

viewer/packages/cad-styling/src/NodeAppearanceProvider.ts:97


assignStyledNodeCollection

assignStyledNodeCollection(nodeCollection, appearance): void

Parameters
NameType
nodeCollectionNodeCollectionBase
appearanceNodeAppearance
Returns

void

Defined in

viewer/packages/cad-styling/src/NodeAppearanceProvider.ts:65


clear

clear(): void

Returns

void

Defined in

viewer/packages/cad-styling/src/NodeAppearanceProvider.ts:104


off

off(event, listener): void

Parameters
NameType
event"changed"
listener() => void
Returns

void

Defined in

viewer/packages/cad-styling/src/NodeAppearanceProvider.ts:49

off(event, listener): void

Parameters
NameType
event"loadingStateChanged"
listener(isLoading: boolean) => void
Returns

void

Defined in

viewer/packages/cad-styling/src/NodeAppearanceProvider.ts:50


on

on(event, listener): void

Parameters
NameType
event"changed"
listener() => void
Returns

void

Defined in

viewer/packages/cad-styling/src/NodeAppearanceProvider.ts:33

on(event, listener): void

Parameters
NameType
event"loadingStateChanged"
listener(isLoading: boolean) => void
Returns

void

Defined in

viewer/packages/cad-styling/src/NodeAppearanceProvider.ts:34


unassignStyledNodeCollection

unassignStyledNodeCollection(nodeCollection): void

Parameters
NameType
nodeCollectionNodeCollectionBase
Returns

void

Defined in

viewer/packages/cad-styling/src/NodeAppearanceProvider.ts:85

@cognite/reveal / Modules / @cognite/reveal / NodeCollectionBase

Class: NodeCollectionBase

@cognite/reveal.NodeCollectionBase

Abstract class for implementing a set of nodes to be styled.

Hierarchy

Table of contents

Accessors

Methods

Accessors

classToken

get classToken(): string

Returns

string

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:25


isLoading

Abstract get isLoading(): boolean

Returns true when the set currently is running an operation for loading the full set of nodes contained by the set.

Returns

boolean

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:51

Methods

clear

Abstract clear(): void

Clears the set, making it empty.

Returns

void

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:61


getIndexSet

Abstract getIndexSet(): IndexSet

Returns the IndexSet that holds the tree indices of the nodes contained by the set.

Returns

IndexSet

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:56


off

off(event, listener): void

Unsubscribe a listener to events about the set changing, i.e. when nodes are added or removed to the set.

Parameters
NameType
event"changed"
listener() => void
Returns

void

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:42


on

on(event, listener): void

Subscribe a listener to events about the set changing, i.e. when nodes are added or removed to the set.

Parameters
NameType
event"changed"
listener() => void
Returns

void

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:33


serialize

Abstract serialize(): SerializedNodeCollection

Returns

SerializedNodeCollection

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:70

@cognite/reveal / Modules / @cognite/reveal / NotSupportedInMigrationWrapperError

Class: NotSupportedInMigrationWrapperError

@cognite/reveal.NotSupportedInMigrationWrapperError

Hierarchy

  • Error

    NotSupportedInMigrationWrapperError

Table of contents

Constructors

Properties

Constructors

constructor

new NotSupportedInMigrationWrapperError(message?)

Parameters
NameType
message?string
Overrides

Error.constructor

Defined in

viewer/core/src/public/migration/NotSupportedInMigrationWrapperError.ts:10

Properties

message

message: string

Inherited from

Error.message

Defined in

documentation/node_modules/typescript/lib/lib.es5.d.ts:974


name

name: string

Inherited from

Error.name

Defined in

documentation/node_modules/typescript/lib/lib.es5.d.ts:973


stack

Optional stack: string

Inherited from

Error.stack

Defined in

documentation/node_modules/typescript/lib/lib.es5.d.ts:975

@cognite/reveal / Modules / @cognite/reveal / NumericRange

Class: NumericRange

@cognite/reveal.NumericRange

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new NumericRange(from, count)

Parameters
NameType
fromnumber
countnumber
Defined in

viewer/packages/utilities/src/NumericRange.ts:8

Properties

count

Readonly count: number

Defined in

viewer/packages/utilities/src/NumericRange.ts:7


from

Readonly from: number

Defined in

viewer/packages/utilities/src/NumericRange.ts:6


toInclusive

Readonly toInclusive: number

Defined in

viewer/packages/utilities/src/NumericRange.ts:8

Methods

contains

contains(value): boolean

Parameters
NameType
valuenumber
Returns

boolean

Defined in

viewer/packages/utilities/src/NumericRange.ts:38


equal

equal(other): boolean

Parameters
NameType
otherNumericRange
Returns

boolean

Defined in

viewer/packages/utilities/src/NumericRange.ts:34


forEach

forEach(action): void

Parameters
NameType
action(value: number) => void
Returns

void

Defined in

viewer/packages/utilities/src/NumericRange.ts:72


intersectionWith

intersectionWith(range): NumericRange

Parameters
NameType
rangeNumericRange
Returns

NumericRange

Defined in

viewer/packages/utilities/src/NumericRange.ts:50


intersects

intersects(range): boolean

Parameters
NameType
rangeNumericRange
Returns

boolean

Defined in

viewer/packages/utilities/src/NumericRange.ts:42


intersectsOrCoinciding

intersectsOrCoinciding(range): boolean

Parameters
NameType
rangeNumericRange
Returns

boolean

Defined in

viewer/packages/utilities/src/NumericRange.ts:46


isInside

isInside(range): boolean

Parameters
NameType
rangeNumericRange
Returns

boolean

Defined in

viewer/packages/utilities/src/NumericRange.ts:61


toArray

toArray(): number[]

Returns

number[]

Defined in

viewer/packages/utilities/src/NumericRange.ts:30


toString

toString(): string

Returns

string

Defined in

viewer/packages/utilities/src/NumericRange.ts:78


union

union(range): NumericRange

Parameters
NameType
rangeNumericRange
Returns

NumericRange

Defined in

viewer/packages/utilities/src/NumericRange.ts:65


values

values(): Generator<number, any, unknown>

Returns

Generator<number, any, unknown>

Defined in

viewer/packages/utilities/src/NumericRange.ts:24


createFromInterval

Static createFromInterval(from, toInclusive): NumericRange

Parameters
NameType
fromnumber
toInclusivenumber
Returns

NumericRange

Defined in

viewer/packages/utilities/src/NumericRange.ts:20


isNumericRange

Static isNumericRange(value): value is NumericRange

Parameters
NameType
valueany
Returns

value is NumericRange

Defined in

viewer/packages/utilities/src/NumericRange.ts:82

@cognite/reveal / Modules / @cognite/reveal / PropertyFilterNodeCollection

Class: PropertyFilterNodeCollection

@cognite/reveal.PropertyFilterNodeCollection

Represents a set of nodes that has matching node properties to a provided filter. Note that a node is considered to match if it or a NodeCollectionBase ancestors match the filter.

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new PropertyFilterNodeCollection(client, model, options?)

Parameters
NameType
clientdefault
modelCognite3DModel
optionsPropertyFilterNodeCollectionOptions
Overrides

NodeCollectionBase.constructor

Defined in

viewer/core/src/datamodels/cad/styling/PropertyFilterNodeCollection.ts:45

Properties

classToken

Static Readonly classToken: "PropertyFilterNodeCollection"

Defined in

viewer/core/src/datamodels/cad/styling/PropertyFilterNodeCollection.ts:33

Accessors

classToken

get classToken(): string

Returns

string

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:25


isLoading

get isLoading(): boolean

Returns true when the set currently is running an operation for loading the full set of nodes contained by the set.

Returns

boolean

Defined in

viewer/core/src/datamodels/cad/styling/PropertyFilterNodeCollection.ts:55

Methods

clear

clear(): void

Clears the node collection and interrupts any ongoing operations.

Returns

void

Overrides

NodeCollectionBase.clear

Defined in

viewer/core/src/datamodels/cad/styling/PropertyFilterNodeCollection.ts:107


executeFilter

executeFilter(filter): Promise<void>

Populates the node collection with nodes matching the provided filter. This will replace the current nodes held by the filter.

example

set.executeFilter({ 'PDMS': { 'Module': 'AQ550' }});
Parameters
NameTypeDescription
filterObjectA filter for matching node properties.
Returns

Promise<void>

Defined in

viewer/core/src/datamodels/cad/styling/PropertyFilterNodeCollection.ts:68


getIndexSet

getIndexSet(): IndexSet

Returns

IndexSet

Overrides

NodeCollectionBase.getIndexSet

Defined in

viewer/core/src/datamodels/cad/styling/PropertyFilterNodeCollection.ts:115


off

off(event, listener): void

Unsubscribe a listener to events about the set changing, i.e. when nodes are added or removed to the set.

Parameters
NameType
event"changed"
listener() => void
Returns

void

Inherited from

NodeCollectionBase.off

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:42


on

on(event, listener): void

Subscribe a listener to events about the set changing, i.e. when nodes are added or removed to the set.

Parameters
NameType
event"changed"
listener() => void
Returns

void

Inherited from

NodeCollectionBase.on

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:33


serialize

serialize(): SerializedNodeCollection

Returns

SerializedNodeCollection

Overrides

NodeCollectionBase.serialize

Defined in

viewer/core/src/datamodels/cad/styling/PropertyFilterNodeCollection.ts:119

@cognite/reveal / Modules / @cognite/reveal / SinglePropertyFilterNodeCollection

Class: SinglePropertyFilterNodeCollection

@cognite/reveal.SinglePropertyFilterNodeCollection

Node collection that filters nodes based on a node property from a list of values, similarly to how SELECT ... IN (...) works. This is useful when looking up nodes based on a list of identifiers, nodes within a set of areas or systems. The node set is optimized for matching with properties with a large number of values (i.e. thousands).

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new SinglePropertyFilterNodeCollection(client, model, options?)

Construct a new node set.

Parameters
NameTypeDescription
clientdefault{@link CogniteClient} authenticated to the project the model is loaded from.
modelCognite3DModelCAD model.
optionsPropertyFilterNodeCollectionOptions
Overrides

NodeCollectionBase.constructor

Defined in

viewer/core/src/datamodels/cad/styling/SinglePropertyFilterNodeCollection.ts:36

Properties

classToken

Static Readonly classToken: "SinglePropertyNodeCollection"

Defined in

viewer/core/src/datamodels/cad/styling/SinglePropertyFilterNodeCollection.ts:24

Accessors

classToken

get classToken(): string

Returns

string

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:25


isLoading

get isLoading(): boolean

Returns true when the set currently is running an operation for loading the full set of nodes contained by the set.

Returns

boolean

Defined in

viewer/core/src/datamodels/cad/styling/SinglePropertyFilterNodeCollection.ts:51

Methods

clear

clear(): void

Clears the node set and interrupts any ongoing operations.

Returns

void

Overrides

NodeCollectionBase.clear

Defined in

viewer/core/src/datamodels/cad/styling/SinglePropertyFilterNodeCollection.ts:104


executeFilter

executeFilter(propertyCategory, propertyKey, propertyValues): Promise<void>

Execute filter asynchronously, replacing any existing filter active. When {@link propertyValues} contains more than 1000 elements, the operation will be split into multiple batches that are executed in parallel. Note that when providing a {@link PropertyFilterNodeCollectionOptions.requestPartitions} during construction of the node set, the total number of batches will be requestPartitions*numberOfBatches.

Parameters
NameTypeDescription
propertyCategorystringNode property category, e.g. 'PDMS'.
propertyKeystringNode property key, e.g. ':FU'.
propertyValuesstring[]Lookup values, e.g. ["AR100APG539","AP500INF534","AP400INF553", ...]
Returns

Promise<void>

Defined in

viewer/core/src/datamodels/cad/styling/SinglePropertyFilterNodeCollection.ts:65


getIndexSet

getIndexSet(): IndexSet

Returns

IndexSet

Overrides

NodeCollectionBase.getIndexSet

Defined in

viewer/core/src/datamodels/cad/styling/SinglePropertyFilterNodeCollection.ts:112


off

off(event, listener): void

Unsubscribe a listener to events about the set changing, i.e. when nodes are added or removed to the set.

Parameters
NameType
event"changed"
listener() => void
Returns

void

Inherited from

NodeCollectionBase.off

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:42


on

on(event, listener): void

Subscribe a listener to events about the set changing, i.e. when nodes are added or removed to the set.

Parameters
NameType
event"changed"
listener() => void
Returns

void

Inherited from

NodeCollectionBase.on

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:33


serialize

serialize(): SerializedNodeCollection

Returns

SerializedNodeCollection

Overrides

NodeCollectionBase.serialize

Defined in

viewer/core/src/datamodels/cad/styling/SinglePropertyFilterNodeCollection.ts:122

@cognite/reveal / Modules / @cognite/reveal / TreeIndexNodeCollection

Class: TreeIndexNodeCollection

@cognite/reveal.TreeIndexNodeCollection

Node collection that holds a set of nodes defined by a set of tree indices.

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new TreeIndexNodeCollection(treeIndexSet?)

Parameters
NameType
treeIndexSet?IndexSet
Overrides

NodeCollectionBase.constructor

Defined in

viewer/packages/cad-styling/src/TreeIndexNodeCollection.ts:13

new TreeIndexNodeCollection(treeIndices?)

Parameters
NameType
treeIndices?Iterable<number>
Overrides

NodeCollectionBase.constructor

Defined in

viewer/packages/cad-styling/src/TreeIndexNodeCollection.ts:15

new TreeIndexNodeCollection(treeIndexRange?)

Parameters
NameType
treeIndexRange?NumericRange
Overrides

NodeCollectionBase.constructor

Defined in

viewer/packages/cad-styling/src/TreeIndexNodeCollection.ts:16

Properties

classToken

Static Readonly classToken: "TreeIndexNodeCollection"

Defined in

viewer/packages/cad-styling/src/TreeIndexNodeCollection.ts:11

Accessors

classToken

get classToken(): string

Returns

string

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:25


isLoading

get isLoading(): boolean

Returns true when the set currently is running an operation for loading the full set of nodes contained by the set.

Returns

boolean

Defined in

viewer/packages/cad-styling/src/TreeIndexNodeCollection.ts:46

Methods

clear

clear(): void

Sets this set to hold an empty set.

Returns

void

Overrides

NodeCollectionBase.clear

Defined in

viewer/packages/cad-styling/src/TreeIndexNodeCollection.ts:37


getIndexSet

getIndexSet(): IndexSet

Returns

IndexSet

Overrides

NodeCollectionBase.getIndexSet

Defined in

viewer/packages/cad-styling/src/TreeIndexNodeCollection.ts:42


off

off(event, listener): void

Unsubscribe a listener to events about the set changing, i.e. when nodes are added or removed to the set.

Parameters
NameType
event"changed"
listener() => void
Returns

void

Inherited from

NodeCollectionBase.off

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:42


on

on(event, listener): void

Subscribe a listener to events about the set changing, i.e. when nodes are added or removed to the set.

Parameters
NameType
event"changed"
listener() => void
Returns

void

Inherited from

NodeCollectionBase.on

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:33


serialize

serialize(): SerializedNodeCollection

Returns

SerializedNodeCollection

Overrides

NodeCollectionBase.serialize

Defined in

viewer/packages/cad-styling/src/TreeIndexNodeCollection.ts:50


updateSet

updateSet(treeIndices): void

Parameters
NameType
treeIndicesIndexSet
Returns

void

Defined in

viewer/packages/cad-styling/src/TreeIndexNodeCollection.ts:29

@cognite/reveal / Modules / @cognite/reveal / UnionNodeCollection

Class: UnionNodeCollection

@cognite/reveal.UnionNodeCollection

Node collection that takes the set union of multiple node collections.

Hierarchy

  • CombineNodeCollectionBase

    UnionNodeCollection

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new UnionNodeCollection(nodeCollections?)

Parameters
NameType
nodeCollections?NodeCollectionBase[]
Overrides

CombineNodeCollectionBase.constructor

Defined in

viewer/packages/cad-styling/src/UnionNodeCollection.ts:14

Properties

classToken

Static Readonly classToken: "UnionNodeCollection"

Defined in

viewer/packages/cad-styling/src/UnionNodeCollection.ts:14

Accessors

classToken

get classToken(): string

Returns

string

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:25


isLoading

get isLoading(): boolean

override

Returns

boolean

Defined in

viewer/packages/cad-styling/src/CombineNodeCollectionBase.ts:65

Methods

add

add(nodeCollection): void

Parameters
NameType
nodeCollectionNodeCollectionBase
Returns

void

Inherited from

CombineNodeCollectionBase.add

Defined in

viewer/packages/cad-styling/src/CombineNodeCollectionBase.ts:24


clear

clear(): void

Clears all underlying node collections.

Returns

void

Inherited from

CombineNodeCollectionBase.clear

Defined in

viewer/packages/cad-styling/src/CombineNodeCollectionBase.ts:44


getIndexSet

getIndexSet(): IndexSet

override

Returns

IndexSet

Inherited from

CombineNodeCollectionBase.getIndexSet

Defined in

viewer/packages/cad-styling/src/CombineNodeCollectionBase.ts:57


off

off(event, listener): void

Unsubscribe a listener to events about the set changing, i.e. when nodes are added or removed to the set.

Parameters
NameType
event"changed"
listener() => void
Returns

void

Inherited from

CombineNodeCollectionBase.off

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:42


on

on(event, listener): void

Subscribe a listener to events about the set changing, i.e. when nodes are added or removed to the set.

Parameters
NameType
event"changed"
listener() => void
Returns

void

Inherited from

CombineNodeCollectionBase.on

Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:33


remove

remove(nodeCollection): void

Parameters
NameType
nodeCollectionNodeCollectionBase
Returns

void

Inherited from

CombineNodeCollectionBase.remove

Defined in

viewer/packages/cad-styling/src/CombineNodeCollectionBase.ts:30


serialize

serialize(): SerializedNodeCollection

Returns

SerializedNodeCollection

Overrides

CombineNodeCollectionBase.serialize

Defined in

viewer/packages/cad-styling/src/UnionNodeCollection.ts:20

@cognite/reveal / Modules / @cognite/reveal/extensions/datasource / CdfModelIdentifier

Class: CdfModelIdentifier

@cognite/reveal/extensions/datasource.CdfModelIdentifier

Identifies a 3D model stored in CDF by the combination of a modelId, a revisionId and a format.

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new CdfModelIdentifier(modelId, revisionId, modelFormat)

Parameters
NameType
modelIdnumber
revisionIdnumber
modelFormatFile3dFormat
Defined in

viewer/packages/modeldata-api/src/CdfModelIdentifier.ts:16

Properties

modelFormat

Readonly modelFormat: File3dFormat

Defined in

viewer/packages/modeldata-api/src/CdfModelIdentifier.ts:13


modelId

Readonly modelId: number

Defined in

viewer/packages/modeldata-api/src/CdfModelIdentifier.ts:15


revealInternalId

Readonly revealInternalId: symbol

Unique ID of the model.

Implementation of

ModelIdentifier.revealInternalId

Defined in

viewer/packages/modeldata-api/src/CdfModelIdentifier.ts:12


revisionId

Readonly revisionId: number

Defined in

viewer/packages/modeldata-api/src/CdfModelIdentifier.ts:16

Methods

toString

toString(): string

Returns

string

Defined in

viewer/packages/modeldata-api/src/CdfModelIdentifier.ts:25

@cognite/reveal / Modules / @cognite/reveal/tools / AxisViewTool

Class: AxisViewTool

@cognite/reveal/tools.AxisViewTool

Hierarchy

Table of contents

Constructors

Methods

Constructors

constructor

new AxisViewTool(viewer, config?)

Parameters
NameType
viewerCognite3DViewer
config?AxisBoxConfig
Overrides

Cognite3DViewerToolBase.constructor

Defined in

viewer/packages/tools/src/AxisView/AxisViewTool.ts:41

Methods

dispose

dispose(): void

Returns

void

Overrides

Cognite3DViewerToolBase.dispose

Defined in

viewer/packages/tools/src/AxisView/AxisViewTool.ts:65


off

off(event, handler): void

Unregisters an event handler for the 'disposed'-event.

Parameters
NameType
event"disposed"
handler() => void
Returns

void

Inherited from

Cognite3DViewerToolBase.off

Defined in

viewer/packages/tools/src/Cognite3DViewerToolBase.ts:37

@cognite/reveal / Modules / @cognite/reveal/tools / Cognite3DViewerToolBase

Class: Cognite3DViewerToolBase

@cognite/reveal/tools.Cognite3DViewerToolBase

Base class for tools attaching to a @see {@link Cognite3DViewer}.

Hierarchy

Table of contents

Constructors

Methods

Constructors

constructor

new Cognite3DViewerToolBase()

Methods

dispose

dispose(): void

Disposes the element and triggeres the 'disposed' event before clearing the list of dipose-listeners.

Returns

void

Defined in

viewer/packages/tools/src/Cognite3DViewerToolBase.ts:52


off

off(event, handler): void

Unregisters an event handler for the 'disposed'-event.

Parameters
NameType
event"disposed"
handler() => void
Returns

void

Defined in

viewer/packages/tools/src/Cognite3DViewerToolBase.ts:37

@cognite/reveal / Modules / @cognite/reveal/tools / DebugCameraTool

Class: DebugCameraTool

@cognite/reveal/tools.DebugCameraTool

Hierarchy

Table of contents

Constructors

Methods

Constructors

constructor

new DebugCameraTool(viewer)

Parameters
NameType
viewerCognite3DViewer
Overrides

Cognite3DViewerToolBase.constructor

Defined in

viewer/packages/tools/src/DebugCameraTool.ts:18

Methods

dispose

dispose(): void

Removes all elements and detaches from the viewer.

override

Returns

void

Overrides

Cognite3DViewerToolBase.dispose

Defined in

viewer/packages/tools/src/DebugCameraTool.ts:32


hideCameraHelper

hideCameraHelper(): void

Returns

void

Defined in

viewer/packages/tools/src/DebugCameraTool.ts:43


off

off(event, handler): void

Unregisters an event handler for the 'disposed'-event.

Parameters
NameType
event"disposed"
handler() => void
Returns

void

Inherited from

Cognite3DViewerToolBase.off

Defined in

viewer/packages/tools/src/Cognite3DViewerToolBase.ts:37


showCameraHelper

showCameraHelper(): void

Returns

void

Defined in

viewer/packages/tools/src/DebugCameraTool.ts:37

@cognite/reveal / Modules / @cognite/reveal/tools / DebugLoadedSectorsTool

Class: DebugLoadedSectorsTool

@cognite/reveal/tools.DebugLoadedSectorsTool

Hierarchy

Table of contents

Constructors

Methods

Constructors

constructor

new DebugLoadedSectorsTool(viewer, options?)

Parameters
NameType
viewerCognite3DViewer
optionsDebugLoadedSectorsToolOptions
Overrides

Cognite3DViewerToolBase.constructor

Defined in

viewer/packages/tools/src/DebugLoadedSectorsTool.ts:25

Methods

dispose

dispose(): void

Returns

void

Overrides

Cognite3DViewerToolBase.dispose

Defined in

viewer/packages/tools/src/DebugLoadedSectorsTool.ts:47


off

off(event, handler): void

Unregisters an event handler for the 'disposed'-event.

Parameters
NameType
event"disposed"
handler() => void
Returns

void

Inherited from

Cognite3DViewerToolBase.off

Defined in

viewer/packages/tools/src/Cognite3DViewerToolBase.ts:37


setOptions

setOptions(options): void

Parameters
NameType
optionsDebugLoadedSectorsToolOptions
Returns

void

Defined in

viewer/packages/tools/src/DebugLoadedSectorsTool.ts:35


showSectorBoundingBoxes

showSectorBoundingBoxes(model): void

Parameters
NameType
modelCognite3DModel
Returns

void

Defined in

viewer/packages/tools/src/DebugLoadedSectorsTool.ts:51

@cognite/reveal / Modules / @cognite/reveal/tools / ExplodedViewTool

Class: ExplodedViewTool

@cognite/reveal/tools.ExplodedViewTool

Hierarchy

Table of contents

Constructors

Accessors

Methods

Constructors

constructor

new ExplodedViewTool(treeIndex, cadModel)

Parameters
NameType
treeIndexnumber
cadModelCognite3DModel
Overrides

Cognite3DViewerToolBase.constructor

Defined in

viewer/packages/tools/src/ExplodedViewTool.ts:16

Accessors

readyPromise

get readyPromise(): Promise<void>

Returns

Promise<void>

Defined in

viewer/packages/tools/src/ExplodedViewTool.ts:14

Methods

dispose

dispose(): void

Disposes the element and triggeres the 'disposed' event before clearing the list of dipose-listeners.

Returns

void

Inherited from

Cognite3DViewerToolBase.dispose

Defined in

viewer/packages/tools/src/Cognite3DViewerToolBase.ts:52


expand

expand(expandRadius): Promise<void>

Parameters
NameType
expandRadiusnumber
Returns

Promise<void>

Defined in

viewer/packages/tools/src/ExplodedViewTool.ts:29


off

off(event, handler): void

Unregisters an event handler for the 'disposed'-event.

Parameters
NameType
event"disposed"
handler() => void
Returns

void

Inherited from

Cognite3DViewerToolBase.off

Defined in

viewer/packages/tools/src/Cognite3DViewerToolBase.ts:37


reset

reset(): void

Returns

void

Defined in

viewer/packages/tools/src/ExplodedViewTool.ts:46

@cognite/reveal / Modules / @cognite/reveal/tools / GeomapTool

Class: GeomapTool

@cognite/reveal/tools.GeomapTool

The GeomapTool is a geolocation for the models and allow the user to place them on the maps.

version New since 2.1.

Hierarchy

Table of contents

Constructors

Methods

Constructors

constructor

new GeomapTool(viewer, config)

Parameters
NameType
viewerCognite3DViewer
configMapConfig
Overrides

Cognite3DViewerToolBase.constructor

Defined in

viewer/packages/tools/src/Geomap/GeomapTool.ts:18

Methods

dispose

dispose(): void

Returns

void

Overrides

Cognite3DViewerToolBase.dispose

Defined in

viewer/packages/tools/src/Geomap/GeomapTool.ts:37


latLongToWorldCoordinates

latLongToWorldCoordinates(latLong): Object

Converts Latitude & Longitude into Vector2 World coordinates on the Map

Parameters
NameTypeDescription
latLongLatLongPositionLatitude & Longitude
Returns

Object

NameType
xnumber
ynumber
Defined in

viewer/packages/tools/src/Geomap/GeomapTool.ts:33


off

off(event, handler): void

Unregisters an event handler for the 'disposed'-event.

Parameters
NameType
event"disposed"
handler() => void
Returns

void

Inherited from

Cognite3DViewerToolBase.off

Defined in

viewer/packages/tools/src/Cognite3DViewerToolBase.ts:37

@cognite/reveal / Modules / @cognite/reveal/tools / HtmlOverlayTool

Class: HtmlOverlayTool

@cognite/reveal/tools.HtmlOverlayTool

Manages HTMLoverlays for @see {@link Cognite3DViewer}. Attaches HTML elements to a 3D position and updates its position/visibility as user moves the camera. This is useful to create HTML overlays to highlight information about key positions in the 3D model.

Attached elements must have CSS style 'position: absolute'. It's also recommended in most cases to have styles 'pointer-events: none' and 'touch-action: none' to avoid interfering with 3D navigation. Consider also applying 'transform: translate(-50%, -50%)' to anchor the center of the element rather than the top-left corner. In some cases the zIndex-attribute is necessary for the element to appear on top of the viewer.

example

const el = document.createElement('div');
el.style.position = 'absolute'; // Required!
// Anchor to center of element
el.style.transform = 'translate(-50%, -50%)';
// Avoid being target for events
el.style.pointerEvents = 'none;
el.style.touchAction = 'none';
// Render in front of other elements
el.style.zIndex = 10;

el.style.color = 'red';
el.innerHtml = '<h1>Overlay</h1>';

const overlayTool = new HtmlOverlayTool(viewer);
overlayTool.add(el, new THREE.Vector3(10, 10, 10));
// ...
overlayTool.remove(el);
// or, to remove all attached elements
overlayTool.clear();

// detach the tool from the viewer
overlayTool.dispose();

Hierarchy

Table of contents

Constructors

Accessors

Methods

Constructors

constructor

new HtmlOverlayTool(viewer, options?)

Parameters
NameType
viewerCognite3DViewer
options?HtmlOverlayToolOptions
Overrides

Cognite3DViewerToolBase.constructor

Defined in

viewer/packages/tools/src/HtmlOverlay/HtmlOverlayTool.ts:161

Accessors

elements

get elements(): { element: HTMLElement ; position3D: Vector3 }[]

Returns all added HTML elements along with their 3D positions.

Returns

{ element: HTMLElement ; position3D: Vector3 }[]

Defined in

viewer/packages/tools/src/HtmlOverlay/HtmlOverlayTool.ts:181

Methods

add

add(htmlElement, position3D, options?): void

Registers a HTML overlay that will be updated on rendering.

Parameters
NameType
htmlElementHTMLElement
position3DVector3
optionsHtmlOverlayOptions
Returns

void

Defined in

viewer/packages/tools/src/HtmlOverlay/HtmlOverlayTool.ts:205


clear

clear(): void

Removes all attached HTML overlay elements.

Returns

void

Defined in

viewer/packages/tools/src/HtmlOverlay/HtmlOverlayTool.ts:253


dispose

dispose(): void

Removes all elements and detaches from the viewer.

override

Returns

void

Overrides

Cognite3DViewerToolBase.dispose

Defined in

viewer/packages/tools/src/HtmlOverlay/HtmlOverlayTool.ts:191


forceUpdate

forceUpdate(): void

Updates positions of all overlays. This is automatically managed and there shouldn't be any reason to trigger this unless the attached elements are modified externally.

Calling this function often might cause degraded performance.

Returns

void

Defined in

viewer/packages/tools/src/HtmlOverlay/HtmlOverlayTool.ts:268


off

off(event, handler): void

Unregisters an event handler for the 'disposed'-event.

Parameters
NameType
event"disposed"
handler() => void
Returns

void

Inherited from

Cognite3DViewerToolBase.off

Defined in

viewer/packages/tools/src/Cognite3DViewerToolBase.ts:37


remove

remove(htmlElement): void

Removes a overlay and removes it from the DOM.

Parameters
NameType
htmlElementHTMLElement
Returns

void

Defined in

viewer/packages/tools/src/HtmlOverlay/HtmlOverlayTool.ts:241

@cognite/reveal / Modules / @cognite/reveal/tools / Keyframe

Class: Keyframe

@cognite/reveal/tools.Keyframe

Timeline Key Frames contains parameters to access Nodes, Styles for the Timeline

Table of contents

Constructors

Methods

Constructors

constructor

new Keyframe(model, date)

Parameters
NameType
modelCognite3DModel
dateDate
Defined in

viewer/packages/tools/src/Timeline/Keyframe.ts:15

Methods

activate

activate(): void

Assigns the styles for the node set for the model for this Keyframe

Returns

void

Defined in

viewer/packages/tools/src/Timeline/Keyframe.ts:33


assignStyledNodeCollection

assignStyledNodeCollection(nodeCollection, nodeAppearance): void

Add node & style to the collection

Parameters
NameTypeDescription
nodeCollectionNodeCollectionBaseNode set to apply the Styles
nodeAppearanceNodeAppearanceStyle to assign to the node collection
Returns

void

Defined in

viewer/packages/tools/src/Timeline/Keyframe.ts:53


deactivate

deactivate(): void

Removes the style for the model

Returns

void

Defined in

viewer/packages/tools/src/Timeline/Keyframe.ts:42


getKeyframeDate

getKeyframeDate(): Date

Get date of the Keyframe

Returns

Date

date

Defined in

viewer/packages/tools/src/Timeline/Keyframe.ts:26


unassignStyledNodeCollection

unassignStyledNodeCollection(nodeCollection): void

Remove Node & Style for this keyframe's nodeCollection and nodeAppearance

Parameters
NameTypeDescription
nodeCollectionNodeCollectionBaseNodes to be unassign from node collection
Returns

void

Defined in

viewer/packages/tools/src/Timeline/Keyframe.ts:70

@cognite/reveal / Modules / @cognite/reveal/tools / TimelineTool

Class: TimelineTool

@cognite/reveal/tools.TimelineTool

Tool to applying styles to nodes based on date to play them over in Timeline

Hierarchy

Table of contents

Constructors

Methods

Constructors

constructor

new TimelineTool(cadModel)

Parameters
NameType
cadModelCognite3DModel
Overrides

Cognite3DViewerToolBase.constructor

Defined in

viewer/packages/tools/src/Timeline/TimelineTool.ts:20

Methods

createKeyframe

createKeyframe(date): Keyframe

Create Key frame for the Timeline

Parameters
NameTypeDescription
dateDatedate value by Date.now() since January 1, 1970
Returns

Keyframe

Defined in

viewer/packages/tools/src/Timeline/TimelineTool.ts:63


dispose

dispose(): void

Returns

void

Overrides

Cognite3DViewerToolBase.dispose

Defined in

viewer/packages/tools/src/Timeline/TimelineTool.ts:184


getAllKeyframes

getAllKeyframes(): Keyframe[]

Provides all Keyframes in the Timeline

Returns

Keyframe[]

All Keyframes in Timeline

Defined in

viewer/packages/tools/src/Timeline/TimelineTool.ts:180


getKeyframeByDate

getKeyframeByDate(date): Keyframe

Returns the keyframe at the date given, or undefined if not found.

Parameters
NameType
dateDate
Returns

Keyframe

Defined in

viewer/packages/tools/src/Timeline/TimelineTool.ts:76


off

off(event, handler): void

Unregisters an event handler for the 'disposed'-event.

Parameters
NameType
event"disposed"
handler() => void
Returns

void

Inherited from

Cognite3DViewerToolBase.off

Defined in

viewer/packages/tools/src/Cognite3DViewerToolBase.ts:37


pause

pause(): void

Pause any ongoing playback

Returns

void

Defined in

viewer/packages/tools/src/Timeline/TimelineTool.ts:161


play

play(startDate, endDate, totalDurationInMilliSeconds): void

Starts playback of Timeline

Parameters
NameTypeDescription
startDateDateKeyframe date to start the Playback of Keyframes
endDateDateKeyframe date to stop the Playback of Keyframes
totalDurationInMilliSecondsnumberNumber of milliseconds for all Keyframe within startDate & endDate to be rendered
Returns

void

Defined in

viewer/packages/tools/src/Timeline/TimelineTool.ts:110


removeKeyframe

removeKeyframe(keyframe): void

Removes the Keyframe from the timeline. Does nothing if the keyframe isn't part of the timeline.

Parameters
NameTypeDescription
keyframeKeyframeKeyframe to be removed from the timeline
Returns

void

Defined in

viewer/packages/tools/src/Timeline/TimelineTool.ts:84


removeKeyframeByDate

removeKeyframeByDate(date): void

Removes the Keyframe from the Timeline

Parameters
NameTypeDescription
dateDateDate of the Keyframe to be removed from the Timeline
Returns

void

Defined in

viewer/packages/tools/src/Timeline/TimelineTool.ts:96


resume

resume(): void

Resume any paused playback

Returns

void

Defined in

viewer/packages/tools/src/Timeline/TimelineTool.ts:170


stop

stop(): void

Stops any ongoing playback

Returns

void

Defined in

viewer/packages/tools/src/Timeline/TimelineTool.ts:151


subscribe

subscribe(event, listener): void

Subscribe to the Date changed event

Parameters
NameTypeDescription
event"dateChanged"dateChanged event
listenerTimelineDateUpdateDelegateListen to Timeline date Update during Playback
Returns

void

Defined in

viewer/packages/tools/src/Timeline/TimelineTool.ts:34


unsubscribe

unsubscribe(event, listener): void

Unsubscribe to the Date changed event

Parameters
NameTypeDescription
event"dateChanged"dateChanged event
listenerTimelineDateUpdateDelegateRemove Listen to Timeline date Update
Returns

void

Defined in

viewer/packages/tools/src/Timeline/TimelineTool.ts:49

Enums

@cognite/reveal / Modules / @cognite/reveal / NodeOutlineColor

Enumeration: NodeOutlineColor

@cognite/reveal.NodeOutlineColor

Table of contents

Enumeration members

Enumeration members

Black

Black = 2

Defined in

viewer/packages/cad-styling/src/NodeAppearance.ts:8


Blue

Blue = 4

Defined in

viewer/packages/cad-styling/src/NodeAppearance.ts:10


Cyan

Cyan = 3

Defined in

viewer/packages/cad-styling/src/NodeAppearance.ts:9


Green

Green = 5

Defined in

viewer/packages/cad-styling/src/NodeAppearance.ts:11


NoOutline

NoOutline = 0

Defined in

viewer/packages/cad-styling/src/NodeAppearance.ts:6


Orange

Orange = 7

Defined in

viewer/packages/cad-styling/src/NodeAppearance.ts:13


Red

Red = 6

Defined in

viewer/packages/cad-styling/src/NodeAppearance.ts:12


White

White = 1

Defined in

viewer/packages/cad-styling/src/NodeAppearance.ts:7

@cognite/reveal / Modules / @cognite/reveal / PotreePointColorType

Enumeration: PotreePointColorType

@cognite/reveal.PotreePointColorType

Table of contents

Enumeration members

Enumeration members

Classification

Classification

Indicates whether a point is part of some class of objects. Classes are mapped to colors.

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:35


Depth

Depth

Shows the distance from current camera with color gradient

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:17


Height

Height

Height, or elevation, mapped to a color with a gradient.

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:20


Intensity

Intensity

Indicates the strength of the backscattered signal in a laser scan.

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:38


LevelOfDetail

LevelOfDetail

Calculated during rendering. It is equal to the level of the most detailed visible node in a region

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:29


PointIndex

PointIndex

Specifies the order in which points were captured from a single beam.

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:23


Rgb

Rgb

Describes the observed real-world color of a point.

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:14

@cognite/reveal / Modules / @cognite/reveal / PotreePointShape

Enumeration: PotreePointShape

@cognite/reveal.PotreePointShape

Table of contents

Enumeration members

Enumeration members

Circle

Circle

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:8


Square

Square

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:9

@cognite/reveal / Modules / @cognite/reveal / PotreePointSizeType

Enumeration: PotreePointSizeType

@cognite/reveal.PotreePointSizeType

Table of contents

Enumeration members

Enumeration members

Adaptive

Adaptive

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:42


Fixed

Fixed

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:43

@cognite/reveal / Modules / @cognite/reveal / WellKnownAsprsPointClassCodes

Enumeration: WellKnownAsprsPointClassCodes

@cognite/reveal.WellKnownAsprsPointClassCodes

ASPRS well known point class types.

see http://www.asprs.org/wp-content/uploads/2019/03/LAS_1_4_r14.pdf (page 30)

Table of contents

Enumeration members

Enumeration members

BridgeDeck

BridgeDeck = 17

Note that WellKnownAsprsPointClassCodes.ReservedOrBridgeDeck has been used historically.

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:100


Building

Building = 6

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:65


Created

Created = 0

Created, never classified.

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:59


Default

Default = -1

Special value for all other classes. Some point in Potree might be in this class

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:55


Ground

Ground = 2

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:61


HighNoise

HighNoise = 18

High point, or "high noise". Note that WellKnownAsprsPointClassCodes.ReservedOrHighPoint has been used historically.

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:106


HighVegetation

HighVegetation = 5

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:64


IgnoredGround

IgnoredGround = 20

E.g. breakline proximity.

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:114


LowPoint

LowPoint = 7

Low point, typically "low noise".

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:69


LowVegetation

LowVegetation = 3

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:62


MedVegetation

MedVegetation = 4

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:63


OverheadStructure

OverheadStructure = 19

E.g. conveyors, mining equipment, traffic lights.

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:110


Rail

Rail = 10

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:76


ReservedOrBridgeDeck

ReservedOrBridgeDeck = 12

In previous revisions of LAS this was "Bridge deck", but in more recent revisions this value is reserved.

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:82


ReservedOrHighPoint

ReservedOrHighPoint = 8

In previous revisions of LAS this was High point ("high noise"), in more recent revisions this value is reserved.

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:74


RoadSurface

RoadSurface = 11

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:77


Snow

Snow = 21

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:115


TemporalExclusion

TemporalExclusion = 22

Features excluded due to changes over time between data sources – e.g., water levels, landslides, permafrost

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:120


TransmissionTower

TransmissionTower = 15

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:91


Unclassified

Unclassified = 1

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:60


UserDefinableOffset

UserDefinableOffset = 64

First user definable class identifier (64). Values up to and including 63 are reserved

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:126


Water

Water = 9

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:75


WireConductor

WireConductor = 14

Wire conductor (phase).

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:90


WireGuard

WireGuard = 13

Wire guard shield.

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:86


WireStructureConnector

WireStructureConnector = 16

Wire-structure connector (e.g. insulator).

Defined in

viewer/core/src/datamodels/pointcloud/types.ts:95

@cognite/reveal / Modules / @cognite/reveal/tools / BingMapImageFormat

Enumeration: BingMapImageFormat

@cognite/reveal/tools.BingMapImageFormat

Bing Map Tile Image formats

Table of contents

Enumeration members

Enumeration members

GIF

GIF = "gif"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:87


JPEG

JPEG = "jpeg"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:88


PNG

PNG = "png"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:89

@cognite/reveal / Modules / @cognite/reveal/tools / BingMapType

Enumeration: BingMapType

@cognite/reveal/tools.BingMapType

Bing Map View (aerial, road, bird's eye view of the map)

Table of contents

Enumeration members

Enumeration members

Aerial

Aerial = "a"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:76


Aerial_Labels

Aerial_Labels = "h"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:78


Oblique

Oblique = "o"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:79


Oblique_Labels

Oblique_Labels = "b"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:80


Road

Road = "r"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:77

@cognite/reveal / Modules / @cognite/reveal/tools / Corner

Enumeration: Corner

@cognite/reveal/tools.Corner

A corner of the viewer.

Table of contents

Enumeration members

Enumeration members

BottomLeft

BottomLeft = 2

Defined in

viewer/packages/tools/src/AxisView/types.ts:100


BottomRight

BottomRight = 3

Defined in

viewer/packages/tools/src/AxisView/types.ts:101


TopLeft

TopLeft = 1

Defined in

viewer/packages/tools/src/AxisView/types.ts:99


TopRight

TopRight = 0

Defined in

viewer/packages/tools/src/AxisView/types.ts:98

@cognite/reveal / Modules / @cognite/reveal/tools / HereMapImageFormat

Enumeration: HereMapImageFormat

@cognite/reveal/tools.HereMapImageFormat

Here Map Tiles Image Format

Table of contents

Enumeration members

Enumeration members

JPG

JPG = "jpg"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:118


PNG

PNG = "png"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:116


PNG8

PNG8 = "png8"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:117

@cognite/reveal / Modules / @cognite/reveal/tools / HereMapScheme

Enumeration: HereMapScheme

@cognite/reveal/tools.HereMapScheme

Here Map View Scheme like day, night, satellite, terrain

Table of contents

Enumeration members

Enumeration members

Day

Day = "normal.day"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:106


Night

Night = "normal.night"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:107


Satellite

Satellite = "satellite.day"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:109


Terrain

Terrain = "terrain.day"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:108

@cognite/reveal / Modules / @cognite/reveal/tools / HereMapType

Enumeration: HereMapType

@cognite/reveal/tools.HereMapType

Here Map types

Table of contents

Enumeration members

Enumeration members

Aerial

Aerial = "aerial"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:96


Base

Base = "base"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:97


Pano

Pano = "pano"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:98


Traffic

Traffic = "traffic"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:99

@cognite/reveal / Modules / @cognite/reveal/tools / MapboxImageFormat

Enumeration: MapboxImageFormat

@cognite/reveal/tools.MapboxImageFormat

Mapbox Map image tile format

Table of contents

Enumeration members

Enumeration members

JPG70

JPG70 = "jpg70"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:66


JPG80

JPG80 = "jpg80"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:67


JPG90

JPG90 = "jpg90"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:68


PNG

PNG = "png"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:61


PNG128

PNG128 = "png128"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:64


PNG256

PNG256 = "png256"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:65


PNG32

PNG32 = "png32"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:62


PNG64

PNG64 = "png64"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:63


PNGRAW

PNGRAW = "pngraw"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:69

@cognite/reveal / Modules / @cognite/reveal/tools / MapboxMode

Enumeration: MapboxMode

@cognite/reveal/tools.MapboxMode

Map data for Mapbox

Table of contents

Enumeration members

Enumeration members

Map_Id

Map_Id = 101

Access the map data using a map id or Tileset id. For details see https://docs.mapbox.com/help/glossary/tileset-id/

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:26


Style

Style = 100

Access the map data using a map style. For details see https://docs.mapbox.com/api/maps/styles/

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:22

@cognite/reveal / Modules / @cognite/reveal/tools / MapboxStyle

Enumeration: MapboxStyle

@cognite/reveal/tools.MapboxStyle

Mapbox Map Style, these are pre-defined styles using map/tileset id, created in Mapbox Studio style editor. This is used when MapboxMode.Style is used for mode.

Table of contents

Enumeration members

Enumeration members

Dark

Dark = "mapbox/dark-v9"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:37


Light

Light = "mapbox/light-v9"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:36


Navigation_Day = "mapbox/navigation-preview-day-v4"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:40


Navigation_Guide_Day = "mapbox/navigation-guidance-day-v4"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:42


Navigation_Guide_Night = "mapbox/navigation-guidance-night-v4"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:43


Navigation_Night = "mapbox/navigation-preview-night-v4"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:41


Outdoor

Outdoor = "mapbox/outdoors-v10"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:35


Satellite

Satellite = "mapbox/satellite-v9"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:38


Satellite_Streets

Satellite_Streets = "mapbox/satellite-streets-v10"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:39


Streets

Streets = "mapbox/streets-v10"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:34

@cognite/reveal / Modules / @cognite/reveal/tools / MapProviders

Enumeration: MapProviders

@cognite/reveal/tools.MapProviders

Supported map Providers Bing, Here & Mapbox

Table of contents

Enumeration members

Enumeration members

BingMap

BingMap = "BingMap"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:9


HereMap

HereMap = "HereMap"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:10


MapboxMap

MapboxMap = "MapboxMap"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:11


OpenStreetMap

OpenStreetMap = "OpenStreetMap"

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:12

Interfaces

@cognite/reveal / Modules / @cognite/reveal / AddModelOptions

Interface: AddModelOptions

@cognite/reveal.AddModelOptions

Table of contents

Properties

Properties

geometryFilter

Optional geometryFilter: GeometryFilter

Defined in

viewer/core/src/public/migration/types.ts:190


localPath

Optional localPath: string

Defined in

viewer/core/src/public/migration/types.ts:189


modelId

modelId: number

Defined in

viewer/core/src/public/migration/types.ts:186


revisionId

revisionId: number

Defined in

viewer/core/src/public/migration/types.ts:187

@cognite/reveal / Modules / @cognite/reveal / Cognite3DViewerOptions

Interface: Cognite3DViewerOptions

@cognite/reveal.Cognite3DViewerOptions

Table of contents

Properties

Properties

antiAliasingHint

Optional antiAliasingHint: "disabled" | "fxaa" | "msaa2+fxaa" | "msaa4+fxaa" | "msaa8+fxaa" | "msaa16+fxaa" | "msaa2" | "msaa4" | "msaa8" | "msaa16"

Hints Reveal to use a given anti-aliasing technique.

Fast approximate anti-aliasing (FXAA) is a fast technique that will remove some, but not all aliasing effects. See https://en.wikipedia.org/wiki/Fast_approximate_anti-aliasing.

Multi-sampling anti-aliasinbg (MSAA) is a technique for taking multiple samples per pixel to avoid aliasing effects. This mode requires WebGL 2. See https://www.khronos.org/opengl/wiki/Multisampling.

The combined modes will apply both MSAA and FXAA anti-aliasing and yields the best visual result.

When using the MSAA modes combined with FXAA Reveal will fall back to FXAA on WebGL 1. There is no fallback for the "plain" MSAA modes on WebGL 1.

Currently the default mode is FXAA, but this is subject to change.

Defined in

viewer/core/src/public/migration/types.ts:123


automaticCameraNearFar

Optional automaticCameraNearFar: boolean

When false, camera near and far planes will not be updated automatically (defaults to true). This can be useful when you have custom content in the 3D view and need to better control the view frustum.

When automatic camera near/far planes are disabled, you are responsible for setting this on your own.

example

viewer.camera.near = 0.1;
viewer.camera.far = 1000.0;
viewer.camera.updateProjectionMatrix();
Defined in

viewer/core/src/public/migration/types.ts:94


automaticControlsSensitivity

Optional automaticControlsSensitivity: boolean

When false, the sensitivity of the camera controls will not be updated automatically. This can be useful to better control the sensitivity of the 3D navigation.

When not set, control the sensitivity of the camera using viewer.cameraControls.minDistance and viewer.cameraControls.maxDistance.

Defined in

viewer/core/src/public/migration/types.ts:103


customDataSource

Optional customDataSource: DataSource

Allows providing a custom data source that Reveal will use to load model data. Note that some features might not work when implementing a custom data source. Please refer to the Reveal documentation for details.

Note that the data source must support CdfModelIdentifier.

This cannot be used together with {@link _localModels}.

Defined in

viewer/core/src/public/migration/types.ts:159


domElement

Optional domElement: HTMLElement

An existing DOM element that we will render canvas into.

Defined in

viewer/core/src/public/migration/types.ts:55


enableEdges

Optional enableEdges: boolean

Enables / disables visualizing the edges of geometry. Defaults to true.

Defined in

viewer/core/src/public/migration/types.ts:144


loadingIndicatorStyle

Optional loadingIndicatorStyle: Object

Style the loading indicator.

Type declaration
NameTypeDescription
opacitynumberOpacity of the spinner in fractions. Valid values are between 0.2 and 1.0. Defaults to 1.0.
placement"topLeft" | "topRight" | "bottomLeft" | "bottomRight"What corner the spinner should be placed in. Defaults top topLeft.
Defined in

viewer/core/src/public/migration/types.ts:68


logMetrics

Optional logMetrics: boolean

Send anonymous usage statistics.

Defined in

viewer/core/src/public/migration/types.ts:58


onLoading

Optional onLoading: OnLoadingCallback

Callback to download stream progress.

Defined in

viewer/core/src/public/migration/types.ts:147


renderTargetOptions

Optional renderTargetOptions: Object

Render to offscreen buffer instead of canvas.

Type declaration
NameType
autoSetSize?boolean
targetWebGLRenderTarget
Defined in

viewer/core/src/public/migration/types.ts:63


renderer

Optional renderer: WebGLRenderer

Renderer used to visualize model (optional).

Defined in

viewer/core/src/public/migration/types.ts:105


sdk

sdk: default

Initialized connection to CDF used to load data.

Defined in

viewer/core/src/public/migration/types.ts:52


ssaoQualityHint

Optional ssaoQualityHint: "disabled" | "medium" | "high" | "veryhigh"

Hints the renderer of the quality it should aim for for screen space ambient occlusion, an effect creating shadows and that gives the rendered image more depth.

Defined in

viewer/core/src/public/migration/types.ts:139

@cognite/reveal / Modules / @cognite/reveal / CogniteModelBase

Interface: CogniteModelBase

@cognite/reveal.CogniteModelBase

Implemented by

Table of contents

Properties

Methods

Properties

type

Readonly type: SupportedModelTypes

Defined in

viewer/core/src/public/migration/CogniteModelBase.ts:13

Methods

dispose

dispose(): void

Returns

void

Defined in

viewer/core/src/public/migration/CogniteModelBase.ts:14


getCameraConfiguration

getCameraConfiguration(): CameraConfiguration

Returns

CameraConfiguration

Defined in

viewer/core/src/public/migration/CogniteModelBase.ts:16


getModelBoundingBox

getModelBoundingBox(outBbox?, restrictToMostGeometry?): Box3

Parameters
NameType
outBbox?Box3
restrictToMostGeometry?boolean
Returns

Box3

Defined in

viewer/core/src/public/migration/CogniteModelBase.ts:15


getModelTransformation

getModelTransformation(out?): Matrix4

Parameters
NameType
out?Matrix4
Returns

Matrix4

Defined in

viewer/core/src/public/migration/CogniteModelBase.ts:18


setModelTransformation

setModelTransformation(matrix): void

Parameters
NameType
matrixMatrix4
Returns

void

Defined in

viewer/core/src/public/migration/CogniteModelBase.ts:17

@cognite/reveal / Modules / @cognite/reveal / GeometryFilter

Interface: GeometryFilter

@cognite/reveal.GeometryFilter

Table of contents

Properties

Properties

boundingBox

Optional boundingBox: Box3

The bounds to load geometry within. By default this box is in CDF coordinate space which will be transformed into coordinates relative to the model using the the model transformation which can be specified using the CDF API, or set in Cognite Fusion.

see isBoundingBoxInModelCoordinates.

Defined in

viewer/core/src/public/types.ts:31


isBoundingBoxInModelCoordinates

Optional isBoundingBoxInModelCoordinates: boolean

When set, the geometry filter boundingBox will be considered to be in "Reveal/ThreeJS space". Rather than CDF space which is the default. When using Reveal space, the model transformation which can be specified using the CDF API, or set in Cognite Fusion.

Defined in

viewer/core/src/public/types.ts:39

@cognite/reveal / Modules / @cognite/reveal / IntersectionFromPixelOptions

Interface: IntersectionFromPixelOptions

@cognite/reveal.IntersectionFromPixelOptions

Options to control how Cognite3DViewer.getIntersectionFromPixel behaves.

Table of contents

Properties

Properties

pointIntersectionThreshold

Optional pointIntersectionThreshold: number

Threshold (in meters) for how close a point must be an intersection ray for it to be considered an intersection for point clouds. Defaults to 0.05.

Defined in

viewer/core/src/public/migration/types.ts:359

@cognite/reveal / Modules / @cognite/reveal/extensions/datasource / DataSource

Interface: DataSource

@cognite/reveal/extensions/datasource.DataSource

Describes how Reveal data is stored, and provides means to create custom storage providers that Reveal will fetch data from.

version New since 2.2

Table of contents

Methods

Methods

getModelDataProvider

getModelDataProvider(): ModelDataProvider

Gets a client that is able to download geometry and other files for models.

Returns

ModelDataProvider

Defined in

viewer/packages/data-source/src/DataSource.ts:29


getModelMetadataProvider

getModelMetadataProvider(): ModelMetadataProvider

Gets a metadata provider for models.

Returns

ModelMetadataProvider

Defined in

viewer/packages/data-source/src/DataSource.ts:23


getNodesApiClient

getNodesApiClient(): NodesApiClient

Gets a node API client that is able to fetch data about models.

Returns

NodesApiClient

Defined in

viewer/packages/data-source/src/DataSource.ts:18

@cognite/reveal / Modules / @cognite/reveal/extensions/datasource / ModelDataProvider

Interface: ModelDataProvider

@cognite/reveal/extensions/datasource.ModelDataProvider

Provides data for 3D models.

version New since 2.2

Hierarchy

  • HttpHeadersProvider

  • JsonFileProvider

  • BinaryFileProvider

    ModelDataProvider

Table of contents

Properties

Methods

Properties

headers

Readonly headers: HttpHeaders

Inherited from

HttpHeadersProvider.headers

Defined in

viewer/packages/modeldata-api/src/types.ts:34

Methods

getBinaryFile

getBinaryFile(baseUrl, fileName): Promise<ArrayBuffer>

Downloads a binary blob.

Parameters
NameTypeDescription
baseUrlstringBase URL of the model.
fileNamestringFilename of binary file.
Returns

Promise<ArrayBuffer>

Overrides

BinaryFileProvider.getBinaryFile

Defined in

viewer/packages/modeldata-api/src/types.ts:30


getJsonFile

getJsonFile(baseUrl, fileName): Promise<any>

Download and parse a JSON file and return the resulting struct.

Parameters
NameTypeDescription
baseUrlstringBase URL of the model.
fileNamestringFilename of JSON file.
Returns

Promise<any>

Overrides

JsonFileProvider.getJsonFile

Defined in

viewer/packages/modeldata-api/src/types.ts:24

@cognite/reveal / Modules / @cognite/reveal/extensions/datasource / ModelIdentifier

Interface: ModelIdentifier

@cognite/reveal/extensions/datasource.ModelIdentifier

Identifies a 3D model. Typically, implementations will use CdfModelIdentifier.

Implemented by

Table of contents

Properties

Properties

revealInternalId

Readonly revealInternalId: symbol

Unique ID of the model.

Defined in

viewer/packages/modeldata-api/src/ModelIdentifier.ts:12

@cognite/reveal / Modules / @cognite/reveal/extensions/datasource / ModelMetadataProvider

Interface: ModelMetadataProvider

@cognite/reveal/extensions/datasource.ModelMetadataProvider

Provides metadata for 3D models.

version New since 2.2

Table of contents

Methods

Methods

getModelCamera

getModelCamera(identifier): Promise<Object>

Parameters
NameType
identifierModelIdentifier
Returns

Promise<Object>

Defined in

viewer/packages/modeldata-api/src/ModelMetadataProvider.ts:13


getModelMatrix

getModelMatrix(identifier): Promise<Matrix4>

Parameters
NameType
identifierModelIdentifier
Returns

Promise<Matrix4>

Defined in

viewer/packages/modeldata-api/src/ModelMetadataProvider.ts:14


getModelUri

getModelUri(identifier): Promise<string>

Parameters
NameType
identifierModelIdentifier
Returns

Promise<string>

Defined in

viewer/packages/modeldata-api/src/ModelMetadataProvider.ts:12

@cognite/reveal / Modules / @cognite/reveal/extensions/datasource / NodesApiClient

Interface: NodesApiClient

@cognite/reveal/extensions/datasource.NodesApiClient

Client for retrieving metadata information about CAD nodes.

version New since 2.2

Table of contents

Methods

Methods

determineNodeAncestorsByNodeId

determineNodeAncestorsByNodeId(modelId, revisionId, nodeId, generation): Promise<Object>

Determine ancestor subtree span of a given node. If the node doesn't have an ancestor at the generation given, the span of the root node is returned.

Parameters
NameTypeDescription
modelIdnumberID of 3D model
revisionIdnumberID of 3D model revision
nodeIdnumberNode ID of node
generationnumberGeneration to retrieve (0 means node itself, 1 is parent, 2 grand-parent etc).
Returns

Promise<Object>

Defined in

viewer/packages/nodes-api/src/NodesApiClient.ts:52


determineTreeIndexAndSubtreeSizesByNodeIds

determineTreeIndexAndSubtreeSizesByNodeIds(modelId, revisionId, nodeIds): Promise<{ subtreeSize: number ; treeIndex: number }[]>

Determines tree index and subtreeSize (i.e. span of the subtree a node is parent of) given a set of node IDs.

Parameters
NameType
modelIdnumber
revisionIdnumber
nodeIdsnumber[]
Returns

Promise<{ subtreeSize: number ; treeIndex: number }[]>

Defined in

viewer/packages/nodes-api/src/NodesApiClient.ts:38


getBoundingBoxByNodeId

getBoundingBoxByNodeId(modelId, revisionId, nodeId, box?): Promise<Box3>

Determines the bounds of the node provided. Note that the returned box returned will be in "CDF coordinates" and not transformed using the model transformation for the given model.

Parameters
NameTypeDescription
modelIdnumberID of 3D model
revisionIdnumberID of 3D model revision
nodeIdnumberNode ID of node
box?Box3Pre-allocated THREE.Box3 (optional).
Returns

Promise<Box3>

Defined in

viewer/packages/nodes-api/src/NodesApiClient.ts:69


mapNodeIdsToTreeIndices

mapNodeIdsToTreeIndices(modelId, revisionId, nodeIds): Promise<number[]>

Maps a set of "node IDs" that identify nodes, to the respective "tree indexes".

Parameters
NameType
modelIdnumber
revisionIdnumber
nodeIdsnumber[]
Returns

Promise<number[]>

Defined in

viewer/packages/nodes-api/src/NodesApiClient.ts:28


mapTreeIndicesToNodeIds

mapTreeIndicesToNodeIds(modelId, revisionId, treeIndices): Promise<number[]>

Maps a set of "tree indexes" that identify nodes, to the respective "node IDs".

Parameters
NameType
modelIdnumber
revisionIdnumber
treeIndicesnumber[]
Returns

Promise<number[]>

Defined in

viewer/packages/nodes-api/src/NodesApiClient.ts:18

@cognite/reveal / Modules

@cognite/reveal

Table of contents

Modules

Modules

@cognite/reveal / Modules / @cognite/reveal

Module: @cognite/reveal

Table of contents

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

CadIntersection

Ƭ CadIntersection: Object

Type declaration
NameTypeDescription
distanceToCameranumberDistance from the camera to the intersection.
modelCognite3DModelThe model that was intersected.
pointTHREE.Vector3Coordinate of the intersection.
treeIndexnumberTree index of the intersected 3D node.
type"cad"The intersection type.
Defined in

viewer/core/src/public/migration/types.ts:218


CadModelBudget

Ƭ CadModelBudget: Object

Represents a measurement of how much geometry can be loaded.

Type declaration
NameTypeDescription
maximumRenderCostnumberMaximum render cost. This number can be thought of as triangle count, although the number doesn't match this directly.
highDetailProximityThresholdnumberFor 3D models processed before Q1 2022, sectors within this distance from the camera will always be loaded in high details (deprecated).
Defined in

viewer/core/src/public/migration/types.ts:312


CameraChangeDelegate

Ƭ CameraChangeDelegate: (position: THREE.Vector3, target: THREE.Vector3) => void

Type declaration

▸ (position, target): void

Parameters
NameType
positionTHREE.Vector3
targetTHREE.Vector3
Returns

void

Defined in

viewer/core/src/public/migration/types.ts:287


CameraConfiguration

Ƭ CameraConfiguration: Object

Represents a camera configuration, consisting of a camera position and target.

Type declaration
NameType
positionTHREE.Vector3
targetTHREE.Vector3
Defined in

viewer/packages/utilities/src/CameraConfiguration.ts:8


CameraControlsOptions

Ƭ CameraControlsOptions: Object

Type declaration
NameTypeDescription
changeCameraTargetOnClick?booleanEnables or disables change of camera target on mouse click. New target is then set to the point of the model under current cursor position. Default is false.
mouseWheelAction?"zoomToTarget" | "zoomPastCursor" | "zoomToCursor"Sets mouse wheel initiated action. Modes: 'zoomToTarget' - zooms just to the current target (center of the screen) of the camera. 'zoomPastCursor' - zooms in the direction of the ray coming from camera through cursor screen position, allows going through objects. 'zoomToCursor' - mouse wheel scroll zooms towards the point on the model where cursor is hovering over, doesn't allow going through objects. Default is 'zoomPastCursor'.
Defined in

viewer/packages/camera-manager/src/types.ts:5


Color

Ƭ Color: Object

Type declaration
NameType
bnumber
gnumber
rnumber
Defined in

viewer/core/src/public/migration/types.ts:14


DisposedDelegate

Ƭ DisposedDelegate: () => void

Delegate for disposal events.

Type declaration

▸ (): void

Returns

void

Defined in

viewer/core/src/public/migration/types.ts:292


Intersection

Ƭ Intersection: CadIntersection | PointCloudIntersection

Defined in

viewer/core/src/public/migration/types.ts:268


LoadingStateChangeListener

Ƭ LoadingStateChangeListener: (loadingState: LoadingState) => any

Handler for events about data being loaded.

Type declaration

▸ (loadingState): any

Parameters
NameType
loadingStateLoadingState
Returns

any

Defined in

viewer/core/src/public/types.ts:45


ModelState

Ƭ ModelState: Object

Type declaration
NameType
defaultNodeAppearanceNodeAppearance
modelIdnumber
revisionIdnumber
styledSets{ appearance: NodeAppearance ; options?: any ; state: any ; token: string }[]
Defined in

viewer/core/src/utilities/ViewStateHelper.ts:24


NodeAppearance

Ƭ NodeAppearance: Object

Type for defining node appearance profiles to style a 3D CAD model.

see DefaultNodeAppearance

Type declaration
NameTypeDescription
color?[number, number, number]Overrides the default color of the node in RGB. Each component is in range [0, 255]. [0, 0, 0] means no override.
outlineColor?NodeOutlineColorWhen set, an outline is drawn around the node to make it stand out.
renderGhosted?booleanWhen set to true, the node is rendered ghosted, i.e. transparent with a fixed color. This has no effect if renderInFront is true.
renderInFront?booleanWhen set to true, the node is rendered in front of all other nodes even if it's occluded. Note that this take precedence over renderGhosted.
visible?booleanOverrides the visibility of the node.
Defined in

viewer/packages/cad-styling/src/NodeAppearance.ts:20


NodeCollectionDescriptor

Ƭ NodeCollectionDescriptor: Object

Type declaration
NameType
options?any
stateany
tokenTypeName
Defined in

viewer/core/src/datamodels/cad/styling/NodeCollectionDeserializer.ts:25


NodeCollectionSerializationContext

Ƭ NodeCollectionSerializationContext: Object

Type declaration
NameType
clientCogniteClient
modelCognite3DModel
Defined in

viewer/core/src/datamodels/cad/styling/NodeCollectionDeserializer.ts:24


OnLoadingCallback

Ƭ OnLoadingCallback: (itemsLoaded: number, itemsRequested: number, itemsCulled: number) => void

Type declaration

▸ (itemsLoaded, itemsRequested, itemsCulled): void

Parameters
NameType
itemsLoadednumber
itemsRequestednumber
itemsCullednumber
Returns

void

Defined in

viewer/core/src/public/migration/types.ts:45


PointCloudBudget

Ƭ PointCloudBudget: Object

Represents a budget of how many point from point clouds can be loaded at the same time.

Type declaration
NameTypeDescription
numberOfPointsnumberTotal number of points that can be loaded for all point clouds models accumulated.
Defined in

viewer/core/src/public/migration/types.ts:342


PointCloudIntersection

Ƭ PointCloudIntersection: Object

Type declaration
NameTypeDescription
distanceToCameranumberDistance from the camera to the intersection.
modelCognitePointCloudModelThe model that was intersected.
pointTHREE.Vector3Tree index of the intersected 3D node.
pointIndexnumberThe index of the point that was intersected.
type"pointcloud"The intersection type.
Defined in

viewer/core/src/public/migration/types.ts:241


PointerEventDelegate

Ƭ PointerEventDelegate: (event: { offsetX: number ; offsetY: number }) => void

Type declaration

▸ (event): void

Parameters
NameType
eventObject
event.offsetXnumber
event.offsetYnumber
Returns

void

Defined in

viewer/core/src/public/migration/types.ts:280


RevealOptions

Ƭ RevealOptions: Object

property logMetrics Might be used to disable usage statistics.

property nodeAppearanceProvider Style node by tree-index.

property internal Internals are for internal usage only (like unit-testing).

Type declaration
NameType
internal?Object
internal.parseCallback?(parsed: { data: SectorGeometry | SectorQuads ; lod: string }) => void
internal.sectorCuller?SectorCuller
logMetrics?boolean
renderOptions?RenderOptions
Defined in

viewer/core/src/public/types.ts:14


SceneRenderedDelegate

Ƭ SceneRenderedDelegate: (event: { camera: THREE.PerspectiveCamera ; frameNumber: number ; renderTime: number ; renderer: THREE.WebGLRenderer }) => void

Type declaration

▸ (event): void

Parameters
NameType
eventObject
event.cameraTHREE.PerspectiveCamera
event.frameNumbernumber
event.renderTimenumber
event.rendererTHREE.WebGLRenderer
Returns

void

Defined in

viewer/core/src/public/migration/types.ts:299


SerializedNodeCollection

Ƭ SerializedNodeCollection: Object

Type declaration
NameType
options?any
stateany
tokenstring
Defined in

viewer/packages/cad-styling/src/NodeCollectionBase.ts:8


SupportedModelTypes

Ƭ SupportedModelTypes: "pointcloud" | "cad"

Defined in

viewer/core/src/datamodels/base/SupportedModelTypes.ts:4


TypeName

Ƭ TypeName: string

Defined in

viewer/core/src/datamodels/cad/styling/NodeCollectionDeserializer.ts:23


ViewerState

Ƭ ViewerState: Object

Type declaration
NameType
cameraObject
camera.positionObject
camera.position.xnumber
camera.position.ynumber
camera.position.znumber
camera.targetObject
camera.target.xnumber
camera.target.ynumber
camera.target.znumber
modelsModelState[]
Defined in

viewer/core/src/utilities/ViewStateHelper.ts:16


WellKnownUnit

Ƭ WellKnownUnit: "Meters" | "Centimeters" | "Millimeters" | "Micrometers" | "Kilometers" | "Feet" | "Inches" | "Yards" | "Miles" | "Mils" | "Microinches"

Units supported by Cognite3DModel.

Defined in

viewer/core/src/public/migration/types.ts:23

Variables

DefaultNodeAppearance

Const DefaultNodeAppearance: Object

A set of default node appearances used in Reveal.

Type declaration
NameType
DefaultNodeAppearance
GhostedNodeAppearance
HiddenNodeAppearance
HighlightedObject
Highlighted.color?[number, number, number]
Highlighted.outlineColor?NodeOutlineColor
Highlighted.renderGhosted?boolean
Highlighted.renderInFront?boolean
Highlighted.visible?boolean
InFrontNodeAppearance
OutlinedNodeAppearance
Defined in

viewer/packages/cad-styling/src/NodeAppearance.ts:84


revealEnv

Const revealEnv: Object

Used to specify custom url for worker/wasm files in cases when you need the latest local files or CDN is blocked by CSP.

Type declaration
NameType
publicPathstring
Defined in

viewer/packages/utilities/src/revealEnv.ts:9

Functions

registerCustomNodeCollectionType

registerCustomNodeCollectionType<T>(nodeCollectionType, deserializer): void

Type parameters
NameType
TT: NodeCollectionBase<T>
Parameters
NameType
nodeCollectionTypeTypeName
deserializer(descriptor: NodeCollectionDescriptor, context: NodeCollectionSerializationContext) => Promise<T>
Returns

void

Defined in

viewer/core/src/datamodels/cad/styling/NodeCollectionDeserializer.ts:146

@cognite/reveal / Modules / @cognite/reveal/extensions/datasource

Module: @cognite/reveal/extensions/datasource

Table of contents

Classes

Interfaces

@cognite/reveal / Modules / @cognite/reveal/tools

Module: @cognite/reveal/tools

Table of contents

Enumerations

Classes

Type aliases

Type aliases

AbsolutePosition

Ƭ AbsolutePosition: Object

Absolute position in pixels.

Type declaration
NameType
xAbsolutenumber
yAbsolutenumber
Defined in

viewer/packages/tools/src/AxisView/types.ts:47


AxisBoxCompassConfig

Ƭ AxisBoxCompassConfig: Object

Configuration of the compass.

Type declaration
NameTypeDescription
fontColor?THREE.Color-
fontSize?number-
labelDelta?numberOffset in radians of the orientation indicator.
ringLabel?stringLabel of the orientation indicator. Defaults to 'N' for north.
tickColor?THREE.Color-
Defined in

viewer/packages/tools/src/AxisView/types.ts:79


AxisBoxConfig

Ƭ AxisBoxConfig: Object

Configuration of AxisViewTool.

Type declaration
NameTypeDescription
animationSpeed?numberHow long the camera animation lasts when clicking a face of the orientation box.
compass?AxisBoxCompassConfigConfiguration of the compass "base" of the tool.
faces?ObjectConfiguration for each of the faces of the orientation box. Note that Reveal uses a right-handed Y up coordinate system, which might differ from the original model space. To account for this, you might want to reassign labels of the faces.
faces.xNegativeFace?AxisBoxFaceConfig-
faces.xPositiveFace?AxisBoxFaceConfig-
faces.yNegativeFace?AxisBoxFaceConfig-
faces.yPositiveFace?AxisBoxFaceConfig-
faces.zNegativeFace?AxisBoxFaceConfig-
faces.zPositiveFace?AxisBoxFaceConfig-
position?AbsolutePosition | RelativePositionPosition, either absolute or relative.
size?numberSize in pixels of the axis tool.
Defined in

viewer/packages/tools/src/AxisView/types.ts:10


AxisBoxFaceConfig

Ƭ AxisBoxFaceConfig: Object

Configuration of each face of the orientation box.

Type declaration
NameTypeDescription
faceColor?THREE.Color-
fontColor?THREE.Color-
fontSize?number-
label?stringLabel of the respective face, e.g. 'X' or 'Right'.
outlineColor?THREE.Color-
outlineSize?number-
Defined in

viewer/packages/tools/src/AxisView/types.ts:64


BingMapConfig

Ƭ BingMapConfig: Object

Type declaration
NameTypeDescription
APIKeystringBing Map API Key
providerBingMap-
type?BingMapTypeThe type of the map used.
Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:121


DebugLoadedSectorsToolOptions

Ƭ DebugLoadedSectorsToolOptions: Object

Type declaration
NameType
colorBy?"depth" | "lod" | "loadedTimestamp" | "random"
leafsOnly?boolean
sectorPathFilterRegex?string
showDetailedSectors?boolean
showDiscardedSectors?boolean
showSimpleSectors?boolean
Defined in

viewer/packages/tools/src/DebugLoadedSectorsTool.ts:12


HereMapConfig

Ƭ HereMapConfig: Object

Type declaration
NameTypeDescription
APIKeystringHere map API Key
appCode?stringService application code token.
imageFormat?HereMapImageFormatMap image tile format
providerHereMap-
scheme?stringSpecifies the view scheme
size?numberReturned tile map image size. The following sizes are supported: - 256 - 512 - 128 (deprecated, although usage is still accepted)
style?HereMapTypeThe type of maps to be used.
Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:133


HtmlOverlayCreateClusterDelegate

Ƭ HtmlOverlayCreateClusterDelegate: (overlayElements: { htmlElement: HTMLElement ; userData: any }[]) => HTMLElement

Callback that is triggered when a set of overlays are clustered together in HtmlOverlayTool.

Type declaration

▸ (overlayElements): HTMLElement

Parameters
NameType
overlayElements{ htmlElement: HTMLElement ; userData: any }[]
Returns

HTMLElement

Defined in

viewer/packages/tools/src/HtmlOverlay/HtmlOverlayTool.ts:31


HtmlOverlayOptions

Ƭ HtmlOverlayOptions: Object

Options for an overlay added using HtmlOverlayTool.add.

Type declaration
NameTypeDescription
positionUpdatedCallback?HtmlOverlayPositionUpdatedDelegateCallback that is triggered whenever the position of the overlay is updated. Optional.
userData?anyOptional user specified data that is provided to the HtmlOverlayCreateClusterDelegate and HtmlOverlayPositionUpdatedDelegate.
Defined in

viewer/packages/tools/src/HtmlOverlay/HtmlOverlayTool.ts:41


HtmlOverlayPositionUpdatedDelegate

Ƭ HtmlOverlayPositionUpdatedDelegate: (element: HTMLElement, position2D: THREE.Vector2, position3D: THREE.Vector3, distanceToCamera: number, userData: any) => void

Callback that is triggered whenever the 2D position of an overlay is updated in HtmlOverlayTool.

Type declaration

▸ (element, position2D, position3D, distanceToCamera, userData): void

Parameters
NameType
elementHTMLElement
position2DTHREE.Vector2
position3DTHREE.Vector3
distanceToCameranumber
userDataany
Returns

void

Defined in

viewer/packages/tools/src/HtmlOverlay/HtmlOverlayTool.ts:19


MapConfig

Ƭ MapConfig: { latlong: LatLongPosition } & BingMapConfig | HereMapConfig | MapboxConfig | OpenStreetMapConfig

Maps Configuration of GeomapTool.

Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:198


MapboxConfig

Ƭ MapboxConfig: Object

Type declaration
NameTypeDescription
APIKeystringMapbox API Key
idstringMap style or map ID if the mode is set to MAP_ID
mode?MapboxModeMap tile access mode - MapboxMode.STYLE - MapboxMode.MAP_ID
providerMapboxMap-
tileFormat?MapboxImageFormatMap image tile format
useHDPI?booleanFlag to indicate if should use high resolution tiles
Defined in

viewer/packages/tools/src/Geomap/MapConfig.ts:169


RelativePosition

Ƭ RelativePosition: Object

Relative position from a corner of the viewer and a given padding.

Type declaration
NameType
cornerCorner
paddingTHREE.Vector2
Defined in

viewer/packages/tools/src/AxisView/types.ts:56


TimelineDateUpdateDelegate

Ƭ TimelineDateUpdateDelegate: (event: { activeKeyframe: Keyframe | undefined ; date: Date ; endDate: Date ; startDate: Date }) => void

Delegate for Timeline Date update

Type declaration

▸ (event): void

Parameters
NameType
eventObject
event.activeKeyframeKeyframe | undefined
event.dateDate
event.endDateDate
event.startDateDate
Returns

void

Defined in

viewer/packages/tools/src/Timeline/types.ts:8